Page 1 of 1
UEFI and x86-64 for a begginner
Posted: Fri Dec 18, 2015 6:29 pm
by heat
I'm still reasonably new to the osdev thing and i need to ask a question that has always been in the back of my mind.
Should a begginner use (U)EFI and/or x86-64 to make his OS instead of the old BIOS and x86?
I wanted to ask this question early on in my OS, so changing to UEFI and x86-64 isn't as hard as changing later on. I already have a semi-working shell with commands and some basic keyboard handling ,interrupts, and basic stuff like that.
So,should i stick with x86 and BIOS for learning and then i change,or is it not worth it now?
Thanks for the help
,
TheRussianFail
PS: I don't want to spark any BIOS vs UEFI discussion here, I'm just asking for an opinion about developing with UEFI instead of BIOS as a begginner.
Re: UEFI and x86-64 for a begginner
Posted: Fri Dec 18, 2015 6:36 pm
by Combuster
The only "should" is that you should write software for what you intend to use.
Do you want to run on older machines? Do you want to run exclusively on newer machines? Do you want to use the benefits of newer features? Do you want it because you can? Do you want a single solution or multiple alternatives?
Re: UEFI and x86-64 for a begginner
Posted: Fri Dec 18, 2015 8:18 pm
by Brendan
Hi,
TheRussianFail wrote:I'm still reasonably new to the osdev thing and i need to ask a question that has always been in the back of my mind.
Should a begginner use (U)EFI and/or x86-64 to make his OS instead of the old BIOS and x86?
For a serious attempt at creating a modern OS (e.g. that is designed to have at least have some chance of success, for some unknown/random definition of "success"); I'd recommend designing some sort of "intermediate boot state", where all boot loaders put the computer into that "intermediate boot state", and later boot code relies on that "intermediate boot state" and nothing else (and doesn't know or care what the boot loader was). The idea is to allow you to write more boot loaders (BIOS, UEFI, OpenFirmware,
"kexec", OS installed in ROM, etc) whenever you like, without having to change any other part of the OS at all.
However; for your first ever OS you're mostly learning, gaining experience and refining ideas; and it's very unlikely that your first OS will be your final OS, and much more likely that (eventually) you'll start "your OS version 2" to take advantage of what you've learned doing "version 1". With this in mind, I'd be tempted to suggest that a beginner should focus on gaining knowledge (and probably shouldn't be trying to create a serious modern OS on their very first attempt).
If your goal is "gaining knowledge faster", then it can make sense to cut corners (e.g. use something like multi-boot) instead of doing things properly.
Cheers,
Brendan
Re: UEFI and x86-64 for a begginner
Posted: Sat Dec 19, 2015 4:54 am
by heat
Thanks to both of you for replying the topic.
Maybe the better option is for me to stay with BIOS and x86 until i gain enough knowlege, and then i should change to the better(arguably) and more recent tecnologies.
I will investigate a bit more into what Brendan said about an "intermediate boot state" and i will look into the linux kernel source code to see how it does the "intermediate boot state".
TheRussianFail
Re: UEFI and x86-64 for a begginner
Posted: Sat Dec 19, 2015 6:58 am
by Brendan
Hi,
TheRussianFail wrote:I will investigate a bit more into what Brendan said about an "intermediate boot state" and i will look into the linux kernel source code to see how it does the "intermediate boot state".
Linux kernel is always a good example (if you like to learn by other people's mistakes)...
Cheers,
Brendan
Re: UEFI and x86-64 for a begginner
Posted: Sun Dec 20, 2015 9:38 pm
by intx13
I'm biased, but I wouldn't recommend starting with legacy BIOS. There's too many "gotchas", too much variation between machines and between emulators, too many legacy features you have to understand, and ultimately you're developing for a platform in its last days. You'll spend two weeks learning about real mode just so you can put the system into long mode and never need all that legacy stuff again. For the modern PC architecture, UEFI is the standard firmware interface.