OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:17 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Is it still worth learning OS development with BIOS?
PostPosted: Thu Jun 16, 2022 9:14 pm 
Offline

Joined: Wed Sep 02, 2020 3:09 am
Posts: 20
If I want to learn how to develop an operating system and have it be UEFI-based, is it still worth first learning to program it with BIOS and real-mode assembly or is it a waste of time and should I go straight for UEFI?


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Thu Jun 16, 2022 10:36 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
Why do people keep conflating BIOS and OS development? I cannot figure it out. In any case, the difference is the starting point, yes, but before long, your OS is supposed to be independent of the firmware interface. I would suggest you let your kernel be loaded by a bootloader for now and start from there. Then, once you have your feet wet, you can go back and implement a bootloader for your kernel if you still want to. And making a bootloader for a BIOS based system now is just a futile effort, in my opinion. There are no new BIOS based systems coming out.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Thu Jun 16, 2022 11:40 pm 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
nullplan wrote:
And making a bootloader for a BIOS based system now is just a futile effort, in my opinion. There are no new BIOS based systems coming out.

While I agree with the use an existing bootloader suggestion, I don't think I buy this as an argument.

There's still plenty of old BIOS systems out there, and frankly they're probably the ones other people are more likely to be willing to run your hobby OS on - so it can be valuable to target them. Personally, my main test rig is still a BIOS-only machine - a ThinkPad T410 from the very last line before they had EFI - and it's also still an entirely capable machine (if a bit heavy... but it was heavy when it was new, too).

And perhaps there's a bit of value for some people to "check the box" of having done some traditional realmode assembly - especially if they care enough to bother writing their own bootloader. Some people enjoy studying history!

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Fri Jun 17, 2022 10:48 am 
Offline
Member
Member

Joined: Fri May 11, 2018 6:51 am
Posts: 274
I agree with klange. I see some educational value too in writing a BIOS bootloader. It's just cool. Also, even if all physical machines sold in the last 10+ years have UEFI, legacy boot is still widely used in VMs. For example, with QEMU it's just faster to boot with the legacy bootloader than with the UEFI bootloader, because the whole OVMF has to be loaded first and that takes a few seconds.

But yeah, overall it's not something strictly necessary to do/know nowadays. It's something extra. Also, is not really OS-dev. It's somehow related, but it's a different thing. The OS should not care about how has been loaded.

_________________
Tilck, a Tiny Linux-Compatible Kernel: https://github.com/vvaltchev/tilck


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Sat Jun 18, 2022 12:16 am 
Offline
Member
Member
User avatar

Joined: Sun Feb 18, 2007 7:28 pm
Posts: 1564
Hi,

Somewhat in agreement with everyone here but I always have the stance that the boot loader is a component of the completed operating system. Whether it is custom or not is dependent on what your design needs and goals are. If, for example, GrUB meets or exceeds what you need, you might as well use it and not worry about the boot process. If you want to support UEFI only firmware, go for it -- nothing is stopping you if it satisfies what you want.

In our boot loader, firmware specific calls are hidden behind interfaces so it can in theory support any firmware type (current builds for Legacy BIOS and UEFI.) No other code in the loader or outside is dependent on the firmware.

_________________
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Wed Jun 29, 2022 6:06 am 
Offline
Member
Member

Joined: Wed Jun 29, 2022 2:17 am
Posts: 27
Seasoft wrote:
If I want to learn how to develop an operating system and have it be UEFI-based, is it still worth first learning to program it with BIOS and real-mode assembly or is it a waste of time and should I go straight for UEFI?


You'd better go straight for UEFI, but I think it's worth knowing about BIOS and real-mode assembly
And your operating system shouldn't care about how it has been loaded.You should design a general boot specification so that your operating system can be loaded by several ways.

_________________
I'm a new man to develop operating system.


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Thu Jun 30, 2022 2:26 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 812
Location: Hyperspace
If your hobby includes hardware and you look further afield than the Raspberry Pi, you'll find x86/BIOS SBCs. You can also find them in industrial installations.

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Tue Jul 05, 2022 7:14 pm 
Offline
User avatar

Joined: Mon May 02, 2022 2:03 pm
Posts: 12
It is lot easier to start out this way and learn a lot in the process. I believe it is worth it.

_________________
~Voldemort~


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Tue Aug 16, 2022 5:23 am 
Offline

Joined: Fri Nov 26, 2021 3:52 am
Posts: 6
I may be confused but I always thought that the uefi insulates you from the hardware in a way that bios doesn't. If I'm right, then you would want to learn how to use bios hardware for the sake of experience?


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Tue Aug 16, 2022 6:10 am 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
rnd0 wrote:
I may be confused but I always thought that the uefi insulates you from the hardware in a way that bios doesn't. If I'm right, then you would want to learn how to use bios hardware for the sake of experience?

EFI does not "insulate" from the hardware in any meaningfully different way from BIOS.

Both BIOS and EFI offer abstractions over reading from unspecified block storage devices, abstractions for reading keyboard input, abstractions over text output to a display, and abstractions over setting video modes. The way these abstractions are provided is very different, yes, but they offer the same fundamental functionality.

BIOS loads your payload in real mode, EFI loads your payload in protected mode or long mode (depending on the system) and a minimally-specified flat memory layout. Both install interrupt handlers and initialize devices themselves, and both will happily sit on the sidelines as you trash memory, install your own interrupt tables, switch execution modes, and so on, only guaranteeing their abstractions work so long as you stick to their interfaces.

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
 Post subject: Re: Is it still worth learning OS development with BIOS?
PostPosted: Sun Sep 18, 2022 2:26 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
But I get that reading and writing the disk with uefi aswell as many other tasks are way much faster than the BIOS, UEFI Loads my OS instantly and easily where the BIOS stands ahead by seconds.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group