I've also recently discovered the joy of system level programming. I've gone through a few iterations of writing a (incomplete) kernel from scratch using different languages. I started with a 32-bit kernel in C and got as far as preemptive multitasking. Then I decided to try Nim, I found it very ergonomic and lets you write compact code that expresses the main logic without too much syntax noise. But I got blocked by…
Assembly Nights
21–30 of 37 posts
Re: Assembly Nights
#22Re: Assembly Nights
#23I've also recently discovered the joy of system level programming. I've gone through a few iterations of writing a (incomplete) kernel from scratch using different languages. I started with a 32-bit kernel in C and got as far as preemptive multitasking. Then I decided to try Nim, I found it very ergonomic and lets you write compact code that expresses the main logic without too much syntax noise. But I got blocked by…
github? I like the idea of using Nim to write a kernel, and is curious on what the code looks like. Especially, how do you avoid malloc?
I didn't avoid malloc. I provided a simple bump pointer based heap to get things going. Later I'll have to separate things into a UEFI bootloader and a proper kernel image, each with its own allocator (the bootloader will use UEFI memory allocation services, and the kernel will have its own heap).
Re: Assembly Nights
#24I recently started manually writing assembly with focus AVX2 (a flavor of Intel SIMD extensions). The rationale is that these are complex enough that compilers do not always notice the opportunity to use them, so my ultimate goal is to apply this is to find a non-artificial problem where I could beat a compiler :-) I confirm that its one of the most satisfactory ways to add some numbers using a modern computer.
Would you maybe be able to share some of the learning resources you’ve been using? I’ve really been wanting to get into this! :)
* Intel AVX Programming Reference [0] - comprehensive but not very useful as "where do I even start"
* Godbolt[1] to look at code samples produced by compilers. This is good to see how the instructions work together.
* A random discussion that has *some* concepts behind the YMM registers[2]
* Stack Overflow, for example [3]
[0] https://www.intel.com/content/dam/develop/external/us/en/doc...[1] A sample code that generates some AVX2 code: https://godbolt.org/z/Kr1sojov6
[2] https://community.intel.com/t5/Intel-ISA-Extensions/Software...
Re: Assembly Nights
#25As an owner of one these ASUS EeePC netbooks I used links (a different text-only browser) in VGA textmode in NetBSD for many years. For the small screen size, the terminal font is easy on the eyes. Lynx is one of the worst text-only browsers, IMHO. For me, staying in textmode prevents distraction. However I am reading from the www in textmode all the time. A large, complex, Javascript-enabled, advertising-sponsored, graphical browser is not necessary. No idea what "modern Web surfing" means but it does not sound like it is worth the time if all it produces is distraction.
Re: Assembly Nights
#26"Also, though I did install Lynx, this is not a great machine for modern Web surfing (except for ratfactor.com, of course). So it's a pretty distraction-free device." As an owner of one these ASUS EeePC netbooks I used links (a different text-only browser) in VGA textmode in NetBSD for many years. For the small screen size, the terminal font is easy on the eyes. Lynx is one of the worst text-only browsers, IMHO. For…
What are you using then? I didn't like the "bloatedness" of the modern web. So I often use browser "reader mode". But I would happily try something different.
Re: Assembly Nights
#27Unfortunately, this does not work for writing the blog about the project. Hopefully this will change soon, once I write an editor and filesystem...
Re: Assembly Nights
#28Re: Assembly Nights
#29I recently started manually writing assembly with focus AVX2 (a flavor of Intel SIMD extensions). The rationale is that these are complex enough that compilers do not always notice the opportunity to use them, so my ultimate goal is to apply this is to find a non-artificial problem where I could beat a compiler :-) I confirm that its one of the most satisfactory ways to add some numbers using a modern computer.
My favourite way to add numbers, in assembly, was this project: https://github.com/skx/math-compiler I had far too much fun writing it, even though it is completely pointless!
Re: Assembly Nights
#30Kudos to Dave for a great read, he's inspired me to dust off my own EeePC!..