BeagleV Ahead: a RISC-V assembly studying workhorse. "The Art of RISC-V Assembly

Started by lucho, October 04, 2024, 12:22:23 AM

Previous topic - Next topic

lucho

As I mentioned, it's possible for the interested forum members to get SSH access to my machines with the first 7 ISAs my site mentions – AMD64, ARM64, PPC64, SPARC64, RISCV64 and LoongArch64. Undoubtedly, the fastest growing support is for RISC-V as many companies have jumped to the bandwagon. So, knowing RISC-V assembly language becomes almost as important as knowing those of x86 and ARM. But there aren't too many Linux-capable RISC-V machines yet. One of the few is the BeagleV-Ahead, and because it's really ahead of its time, it's not easy to bring it up to a usable by a programmer degree. But after some struggle, I managed to do so and it has Ubuntu 24.04.1 with GCC 13.2, GAS 2.42 and GDB 13.1 running for some months.

Randall Hyde (the author of the excellent "Art of Assembly" book series) considers writing a RISC-V assembly language book but he also has trouble with this board:

BeagleV-Ahead: Not ready for prime time

Do you think it'd be a good idea if I try to reach him and offer him SSH access to my board? When his future book "The Art of RISC-V Assembly" (the next one after his latest one, "The Art of ARM Assembly") is out, any member of this forum willing to learn RISC-V assembly from that book could get SSH access to it too...

FORTRANS

Hi,

Quote from: lucho on October 04, 2024, 12:22:23 AMDo you think it'd be a good idea if I try to reach him and offer him SSH access to my board?

   Actually, that sounds like a good idea.  Please keep this forum up
to date on his and your progress.  Just curious.

Regards,

Steve

lucho


lucho

He wrote that he's busy with his current books on x64 and ARM, and his future RISC-V book will be based on several SBCs, among which (I verified that) the BeagleV Ahead is still the fastest one. "The Art of ARM Assembly" is based on the ARM-based Mac running macOS and the 64-bit Raspberry Pi running Linux. So his examples can be studied also on my ARM machine, if one wishes so.

By the way, RISC-V is the ISA that has the minimum differences between its 32-bit and 64-bit versions. These differences are described in literally a few pages. This is one of its advantages.

hyder

Quote from: lucho on October 08, 2024, 04:56:10 PMHe wrote that he's busy with his current books on x64 and ARM, and his future RISC-V book will be based on several SBCs, among which (I verified that) the BeagleV Ahead is still the fastest one. "The Art of ARM Assembly" is based on the ARM-based Mac running macOS and the 64-bit Raspberry Pi running Linux. So his examples can be studied also on my ARM machine, if one wishes so.

By the way, RISC-V is the ISA that has the minimum differences between its 32-bit and 64-bit versions. These differences are described in literally a few pages. This is one of its advantages.

Here are my current assembly language book projects:
1. Art of ARM Assembly (available in electronic form, treeware coming early next year.
2. In technical review for "The Art of 64-bit Assembly, Vol 2" Probably will come out in late 2026, early 2027 (with the way editorial cycles go).
3. Just one more chapter to write in "The Art of ARM Assembly, volume 2" (though I've been putting this off for a long time; just can't get motivated to finish it).

There are three possible book projects on assembly I'll have to discuss with my publisher:

4. Do a Linux version of "The Art of 64-bit Assembly"
5. Work on the promised third volume of "The Art of 64-bit Assembly" (which will cover optimization).
6. Work on "The Art of RISC-V Assembly"

(4) is fairly easy to do; I've actually converted all the programs in the current (MASM) version of "The Art of 64-bit Assembly" to Gas; just need to translate the text in Vol 1 from Windows to Linux. Given that "The Art of ARM Assembly" is Linux- (and macOS-) based, this is fairly straight-forward. The big question is "Is there a sufficiently large market to justify the effort needed?"
(6) would be cool; and No Starch Press is big on Open-Source/Open Hardware stuff. BUT, is there really a market for such a book?

(5) will happen someday, no matter what. I'm just waiting to see how Vol 2 is received before making the plunge on that project (which will be a tremendous effort, as it's all new code, research, and writing).

In the meantime, there are other non-assembly book projects in the queue as well:

(7) I really need to finish "Write Great Code Vol 4" (it's about half-way done at this point; maybe a third if I'm being honest with myself).

(8) "An Introduction to Programming, Using Swift" The marketplace has proven that there is no market for Books on the Swift programming language. But this book has to be written; I'm about halfway done on that.

(9) A real book on Pico/Pico2 programming. Something heavy-duty, and far beyond the "this is how to blink an LED" books you find out there today.

Unfortunately, publishers have to devote considerable resources and money to make a book happen. So it's important to pick titles that are commercially viable. I'm sure one or more of these books won't reach that level (Swift, I'm looking at you; I may self-publish that on my website like I did the original "Art of Assembly Language" if it is unpublishable). Obviously, I'll put priority on the projects my publisher feels would work best for them (well, that and the Swift book, as it *really* needs to be written).
Cheers,
Randy Hyde


P.S., for what it's worth, here is the table of contents for "The Art of Assembly, Vol 2":
Introduction I-1
1 Advanced macros 1-1
2 Unicode Strings 2-1
3 Transcendental Functions 3-1
4 Advanced Procedures 4-1
5 Concurrent Programming 5-1
6 Object-Oriented Programming With MASM 6-1
7 Exception Handling 7-1
8 Thunks and Closures 8-1
9 Advanced Parameter Implementation 9-1
10 Iterators 10-1
11 Coroutines, Generators, and Fibers 11-1
A ASCII Character Set A-1
B Glossary B-1
C Installing and Using Visual Studio C-1
E Epilog E-1


lucho

#5
Quote from: hyder on December 12, 2024, 11:59:12 AM6. Work on "The Art of RISC-V Assembly"
[...]
(6) would be cool; and No Starch Press is big on Open-Source/Open Hardware stuff. BUT, is there really a market for such a book?

Yes, I believe so. Even though the tempting thought "x86 is the past, ARM is the present, and RISC-V is the future" is not quite true, its last part is ;)

For example, even Synopsys who have got the best (IMHO) instruction set architecture (ARCv3) have abandoned it and started working on RISC-V.

P.S. But I hope that the fact that Synopsys jumped on the RISC-V bandwagon doesn't mean they've abandoned their own ISA, the more so that they published its Programmer's Reference at last. And speaking about the RISC-V bandwagon, just look at the 25 primary RISC-V Foundation members to see who stays behind it:

https://riscv.org/members/