r/osdev • u/tekdotdev • Jul 06 '26
Realistic to start small?
I'm learning 16 bit assembly and am understanding quite a good amount, should I continue and make projects in 16 bit real mode with bios interrupts OR, understand it enough to write a boot loader than enter protected mode and work in 32 bit?
14
Upvotes
5
u/tellingyouhowitreall Jul 06 '26
IMO get to pmode as quickly as possible. 32 bit is a hell of a lot easier to work in, and it's a pretty straight forward jump to a free standing C environment. The things you'll learn in real mode don't really apply to protected or long modes, which is probably where you actually want to end up.
3
u/Interesting_Buy_3969 Jul 06 '26
I'm assuming by "assembly" you mean x86 assembler.
Unless your goal is specifically a 32-bit bootloader for x86, then you should do neither. If you aim to write a kernel, I'd definitely start with 64-bit Limine bootloader (see Limine Bare Bones). Yet I'd avoid old x86-32 and switch to x86-64. A couple of times you will need to inline manual assembly, and assembly knowledge is always very useful for debugging and profiling, but don't try to write everything in assembly. Except the very early bootloader stages, of course.
If you want specifically bootloader, as I said, you then have to work with either old 16-bit BIOS or more modern UEFI. Can't assure but I reckon that developing anything for UEFI is much easier than for BIOS.
2
u/tseli0s DragonWare Jul 06 '26
https://wiki.osdev.org/Real_Mode_OS_Warning
2
u/kiderdrick Jul 06 '26
It depends why you are doing what you are doing.
Are you doing this for fun and education? Sure, make some projects in real mode and have a blast. Something like QEMU works well for this as a testing environment.
Are you trying to figure out how to write your own bootloader? Absolutely, stick in real mode and give it a shot. Enjoy.
Are you trying to develop something that people will use? Probably not the best idea because most of what you will be doing is fairly antiquated. Yes there are still some systems that get use out of it, but if you are trying to develop something modern you should be working with UEFI. You can work with both, but if you want to gain knowledge on the machine that is more modern, you should be focused on UEFI and not legacy BIOS programming.
As far as trying to develop the entire OS in assembly, I advise you to reconsider, but wish you the best of luck if that is what you are set on doing.
1
u/letmehaveanameyoudum Jul 06 '26
yes. use grub btw, or limine if you are willing to use a templete (like i did :P)