Installing kernel on virtual hard disk

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
yerri07
Member
Member
Posts: 26
Joined: Sat Apr 29, 2017 6:56 am

Installing kernel on virtual hard disk

Post by yerri07 »

Hello can any one tell me how to install my os on virtual or real hard disk from disk image os
LtG
Member
Member
Posts: 384
Joined: Thu Aug 13, 2015 4:57 pm

Re: Installing kernel on virtual hard disk

Post by LtG »

yerri07 wrote:Hello can any one tell me how to install my os on virtual or real hard disk from disk image os
Can you be more specific (details)?

Basically, you write your OS to said virtual or real HDD.
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: Installing kernel on virtual hard disk

Post by ~ »

In my OS, I use an existing FAT partition. I can boot from floppy, but I need to write the boot sector and copy the kernel and other optional external program files.

But normally I use FreeDOS or MS-DOS to boot the system, and I read the configuration code from an existing FAT32 partition, from disk, from DOS, as a set of COM files.

Then finally I launch a kernel loader from DOS which loads my kernel.

The result is that I can load my kernel without destroying any partitions or the current configuration.

My OS is like a portable DOS DPMI application just that it's stand-alone, and I plan to expand it as much as any other OS.

You can see how I install my OS by copying a directory containing it into the root directory of a FAT partition, and then boot with DOS, and from DOS I load my stand-alone kernel:
http://f.osdev.org/viewtopic.php?t=32121
yerri07
Member
Member
Posts: 26
Joined: Sat Apr 29, 2017 6:56 am

Re: Installing kernel on virtual hard disk

Post by yerri07 »

LtG wrote:
yerri07 wrote:Hello can any one tell me how to install my os on virtual or real hard disk from disk image os
Can you be more specific (details)?

Basically, you write your OS to said virtual or real HDD.

Like the linux or any other windows install on hard disk and virtual disk(Virtual Machine) , how the process go. How can i do so for my os
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Installing kernel on virtual hard disk

Post by iansjack »

You just copy the files to the disk and install whatever bootloader you are using. Without more details of your OS it's difficult to be more specific about the details.
LtG
Member
Member
Posts: 384
Joined: Thu Aug 13, 2015 4:57 pm

Re: Installing kernel on virtual hard disk

Post by LtG »

Virtual HDD might be simpler at first, so I'll use it as an example, I'll also assume Qemu, if you're using some other hypervisor/emulator then you'll need to check what disk image format it supports.

You just create a file with whatever contents you want the virtual HDD to have, assuming RAW format. So first 512 bytes of the file are the first sector contents. Just write MBR there (assuming you want to boot the Qemu using this disk image), and write whatever you like in other sectors, it's your OS, so it's up to you.

If that doesn't answer your question, then you'll have to be more specific. Note, when I earlier asked for more details, I wasn't asking about other OS's but rather about yours, the question itself is a bit too vague to answer properly.

Btw, how do you boot your OS now? Have you read the PC boot stuff:
http://wiki.osdev.org/Boot_Sequence
http://wiki.osdev.org/System_Initialization_(x86)

You should have some idea what you want to achieve here, explaining that and related details would enable us to answer better. Like do you want the disk image to have some specific file system or not, how your OS expects to be booted, what boot loader/MBR you want to use, how your OS files should be laid out in the disk image/file system, etc.. These are all details you will have to _decide_, so we can't know them..
Post Reply