switching from floppy to hard drive

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
feare56
Member
Member
Posts: 97
Joined: Sun Dec 23, 2012 5:48 pm

switching from floppy to hard drive

Post by feare56 »

I went on and off with OS dev and I am in the mood to completely redo my OS as I wasn't that far. I plan on switching from my floppy compatible boot loader and kernel with hard drive compatible ones but I don't know how to start. Also if I create one that works with a hard drive and burn it to a cd or DVD would it boot? Would I have to make two boot loaders or make one that detects which one it is being booted from and execute the correct lines of code.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: switching from floppy to hard drive

Post by egos »

feare56 wrote:I went on and off with OS dev and I am in the mood to completely redo my OS as I wasn't that far. I plan on switching from my floppy compatible boot loader and kernel with hard drive compatible ones but I don't know how to start.
Write boot loader and make your kernel independent of boot device, then write boot device driver.
Also if I create one that works with a hard drive and burn it to a cd or DVD would it boot?
It's possible in "hard disk emulation" mode but I don't recommend to use such mode. Also you can use CD/DVD booting to boot from real hard disk without rewriting MBR/stage 1 boot loader on that disk (in testing purposes).
Would I have to make two boot loaders or make one that detects which one it is being booted from and execute the correct lines of code.
I recommend to use separate stage 1 boot loaders for every type of boot device/FS.
If you have seen bad English in my words, tell me what's wrong, please.
Casm
Member
Member
Posts: 221
Joined: Sun Oct 17, 2010 2:21 pm
Location: United Kingdom

Re: switching from floppy to hard drive

Post by Casm »

feare56 wrote:I went on and off with OS dev and I am in the mood to completely redo my OS as I wasn't that far. I plan on switching from my floppy compatible boot loader and kernel with hard drive compatible ones but I don't know how to start. Also if I create one that works with a hard drive and burn it to a cd or DVD would it boot? Would I have to make two boot loaders or make one that detects which one it is being booted from and execute the correct lines of code.
I got so far in designing a file system for the hard disk, but then the question arose as to how the hard disk would be formatted so that my file system could sit on it. The answer which came back was the same way every other operating system does it - with a program loaded from the installation floppy disk/CD of course. So now I am contenting myself with loading from a CD, and a formatting program for the hard disk is well down the line.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: switching from floppy to hard drive

Post by egos »

It's not necessary in early stages. You can use some existing file systems and option "Keep current FS" in setup program. Even if you have no distribution CD you can install your OS from other OS using special setup program or "by hand". For example, I have setupmbr and setupldr for Windows. Moreover, I'm working on support for NTFS to include it in setupldr and read-only NTFS driver but still not planning to include that support in setup program.
If you have seen bad English in my words, tell me what's wrong, please.
Post Reply