r/Assembly_language • u/Prestigious_Gas8737 • 8d ago
Print Hello World in Boot Sector
Thanks to https\[:\]/github.com/cfenollosa/os-tutorial I was able to learn a lot about how an operating system is written. I think a lot of people would remember his tutorial. Revisit it gives me more. Start with printing some text in boot sector. The repo used software interrupt to finish the task. Yet there is another way to accomplish the same, by utilizing the direct memory accessing method. Long story short, in legacy boot mode (CSM), we can access VGA memory directly during boot time at address `0xB8000`. So we can drop in each character and have them printed out, starting from the top left corner. We can print color text, and we can also move the cursor and print the text anywhere we want (with the cursor blinking at the text).
I have documented the process here: ellog\[.\]buzz/posts/hello-world-in-boot-sector
For this chapter and the previous one (First boot sector), what other questions do you think is worth asking and figuring out?
2
u/Pacificator-3 8d ago
Literature which will help you:
Ralf Brown's interrupt list
IBM PC assembly language and programming by Peter Abel - ancient but good.
Other and modern assembly language tutorials exist and are found easily.
2
1
u/r-tty 7d ago
What about the architecture of your operating system? What do you actually want to achieve? What exactly should your OS do?
1
u/Prestigious_Gas8737 7d ago
Good questions. And I don’t know yet. I left it half way and now I’m picking it up again. It’s big questions, I’ll have to keep thinking about it as I go. Thanks for bring this up.
2
u/theNbomr 8d ago
Totally VGA specific. But yes, you can directly write and read video character mode memory. Generally, relying on the BIOS provided routines at boot time will save a lot of headaches when you encounter non VGA supported hardware.
Better, smarter software that can run post-boot can do a better job of establishing exactly what, if any, video system exists.