OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:33 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How does it work install the system to disk?
PostPosted: Sun Aug 01, 2021 8:08 pm 
Offline

Joined: Tue Jul 27, 2021 6:26 pm
Posts: 3
Hi, I currently have a ridiculously simple and small operating system, but I was wondering how this idea of ​​loading an operating system onto a disk, HD, SSD works, as mine is currently on the bootable pendrive and when it shuts down, everything is lost.

The bootloader loads my approximately 150b kernel at address 0800h:0000h if I were to load this to disk, would I have to load an exact copy of the same kernel that I load in memory, just on hd? (and all other files)

That's assuming I've already developed a filesystem and drivers to read and write to hd, which isn't the case.

And as would be the mechanics of an installer like Windows, I would have to load in main memory a kind of "installer kernel" that installs the file system on hd (or a partition), and then load the kernel and the whole program . on hd?

but to do that this "installer kernel" would already have to have driver support to detect hd and write to it, and many other things

How does it usually work?

Obs: if there is a typo, understand that I translated on google translator


Top
 Profile  
 
 Post subject: Re: How does it work install the system to disk?
PostPosted: Sun Aug 01, 2021 9:58 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
The "installer kernel" is the same as the regular kernel. To install the OS, there is a program that copies the bootloader, kernel, and other OS files to the disk.


Top
 Profile  
 
 Post subject: Re: How does it work install the system to disk?
PostPosted: Mon Aug 02, 2021 2:43 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
Quote:
How does it work install the system to disk?

Well, it depends on these three questions:
1. Do you want to have on computer only your OS, or you want to do multiboot
2. Is your bootloader GRUB or your own bootloader is loading simple some sectors from disk where is your kernel or your bootloader is loading your kernel from some filesystem
3. Are you installing your OS to legacy or UEFI

Good installer is complex thing. But, for testing you probably do not need anything difficult like it can seem. I personally have my 15 years old computer for testing and I have these answers:
1. I want to have only my OS
2. My bootloader simply read sectors from 1 to end of kernel
3. Legacy boot

So my installer currently works very simply:
1. Write bootloader to sector 0
2. Write kernel from sector 1
3. Everything is done.

_________________
https://github.com/VendelinSlezak/BleskOS


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 70 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