mstdn.io is one of the many independent Mastodon servers you can use to participate in the fediverse.

Administered by:

Server stats:

335
active users

So it suddenly occurs to me that I have a pending on by Operating Systems course. The assignment seems to be trivial: it is to create a bootloader which prints 'Hello World' on the console. Thought it would be interesting to understand this with some help from my mastodon folks 😄

PS: future me, if you happen to be reading this post after you have forgotten about this, you can thank me later.

So looking at what has been provided to me, I have this in the material:

Here is the code after a bit of good formatting(?) but at least its more readable. I have a lot of questions, but we will go through it line by line.

Re: [BITS 16], the most reasonable explanation I could find was that, when Intel introduced 32-bit CPU, it wanted to maintain backward compatibility with its older 16-bit bootloaders. So it made, the 32-bit mode of processing as a protected on-demand mode. Due to this convention, CPU's start processing the code in 16 bit mode, which then can transfer to 32 bits or 64 bits.

Srevin Saju

Meanwhile [ORG 0x7c00] also seems to be born out of convention. The BIOS loads the program to the RAM at 0000:7C00 before your program gets a chance to be executed. We _could_ ignore the ORG (aka origin), but your program will assume that its loaded at 0x0000 instead. (But you could choose to add 0x7c00 on every command if you would like to do the hardway).

I had been looking at what `MOV AH, 0x0E` means and I found this forum.osdev.org/viewtopic.php?, a 13 year old had been trying to make a bootloader. wow I feel so old.

forum.osdev.orgOSDev.org • View topic - What does 'mov ah, 0x0e' mean and do?

And I guess I am done, (at least with printing the character 'A').

For our , we _have_ to use to run them, and create screenshots of the output of the same.

Looks like we have to choose "Floppy" storage type and choose the boot.img which we created earlier.

After several hours of debugging and a hundred open tabs, I present: Hello World in a Bootloader.

I wonder if I can submit this thread as the assignment to my professor.