UEFI and x86-64 for a begginner

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

UEFI and x86-64 for a begginner

Post 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 :D ,

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.
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: UEFI and x86-64 for a begginner

Post 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?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: UEFI and x86-64 for a begginner

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

Re: UEFI and x86-64 for a begginner

Post 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". :D

TheRussianFail
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: UEFI and x86-64 for a begginner

Post 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". :D
Linux kernel is always a good example (if you like to learn by other people's mistakes)... :)


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
intx13
Member
Member
Posts: 112
Joined: Wed Sep 07, 2011 3:34 pm

Re: UEFI and x86-64 for a begginner

Post 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.
Post Reply