How does it work install the system to disk?
Page 1 of 1

Author:  Patrick367 [ Sun Aug 01, 2021 8:08 pm ]
Post subject:  How does it work install the system to disk?

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

Author:  Octocontrabass [ Sun Aug 01, 2021 9:58 pm ]
Post subject:  Re: How does it work install the system to disk?

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.

Author:  Klakap [ Mon Aug 02, 2021 2:43 am ]
Post subject:  Re: How does it work install the system to disk?

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.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group