Writing Kernel to hard drive
- djtrickdog
- Member
- Posts: 39
- Joined: Sat Dec 15, 2007 7:36 pm
Writing Kernel to hard drive
Hello I am developing a OS and i am using MikeOS as my loose base. I want to write MikeOS on my hard drive but i have Windows XP on it already and wish to Still keep it on it :/ . I am using Gag boot loader and have about 40 unpartitioned space on my hd. What do i need to write MikeOS or any kernel to my hard drive? Thanks for the Help guys.
- djtrickdog
- Member
- Posts: 39
- Joined: Sat Dec 15, 2007 7:36 pm
you don't know how to create a partition (?) or you don't know how to put it there your kernel?djtrickdog wrote:ok thanks for the useless reply. Anyone else? I am well aware i need to create a "partition" and put it on there, i just dont know how.Pyrofan1 wrote:create a new partition and put it on there.
Keep coding...
...the sky is the limit
AsteriOS project: http://www.mindfields.gr/main/index.php ... &Itemid=27
...the sky is the limit
AsteriOS project: http://www.mindfields.gr/main/index.php ... &Itemid=27
- djtrickdog
- Member
- Posts: 39
- Joined: Sat Dec 15, 2007 7:36 pm
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
- djtrickdog
- Member
- Posts: 39
- Joined: Sat Dec 15, 2007 7:36 pm
I know that XP has some utility for creating a partition. Isn't FDISK around anymore on XP? As for writing to it -- it depends on if one of your onboard OSes recognizes the filesystem format. If you format the new partition as FAT32, then you just drag and drop like normal from XP. The trick would be to put a new MBR onto the disk to dual boot your kernel on your new partition.
Now what you want to do, depends on the OS, can it be loaded from a hdd, what file sys does it use etc.
I would think your best bet is to make a Dos partion, with dos on, once you have your PC setup to boot multi-OS including Dos, you can go about code or get a program to install "MikeOS" and replace dos.
I would think your best bet is to make a Dos partion, with dos on, once you have your PC setup to boot multi-OS including Dos, you can go about code or get a program to install "MikeOS" and replace dos.
Bah! Read my post!djtrickdog wrote:So the only way is linux? dang windows
ok i have ubuntu live cd i could just use that. thanks for help
That wasn't a "do option 1 THEN do option2 ..." list, it was a "do option 1 OR do option 2..." - i.e. option 2 was a windows-specific solution.JamesM wrote:2) right click my computer -> manage -> drives ... I think you can double click some free space there and make a new partition
Re: Writing Kernel to hard drive
The partition table is located at the offset 446 (Dec, Zero-based) of the MBR. Each partition takes 16 bytes of space. The partition table is 64 bytes long allowing up to 4 partitions to be created (4*16 = 64). Dump your disk MBR into a file using MBRUtils. Search in Google and you will find it. Then create your own partition. The partition structure is:djtrickdog wrote:Hello I am developing a OS and i am using MikeOS as my loose base. I want to write MikeOS on my hard drive but i have Windows XP on it already and wish to Still keep it on it :/ . I am using Gag boot loader and have about 40 unpartitioned space on my hd. What do i need to write MikeOS or any kernel to my hard drive? Thanks for the Help guys.
Code: Select all
(* ----------------------------------- *)
PHDDPartition = ^THDDPartition;
THDDPartition = Packed Record
BootIndicator : Byte;
StartingCHS : Array [0..2] of Byte;
PartitionType : Byte;
EndingCHS : Array [0..2] of Byte;
StartingLBA : DWORD;
PartitionSizeInSectors : DWORD;
end;
(* ----------------------------------- *)
Let me know if you need more help.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
- djtrickdog
- Member
- Posts: 39
- Joined: Sat Dec 15, 2007 7:36 pm
oops sorry misunderstood what you ment.Bah! Read my post!
what is dd? i googled and not sure i found the right thing...
i also searched on wiki
i just created a new partition...thanks for the help!The partition table is located at the offset 446 (Dec, Zero-based) of the MBR. Each partition takes 16 bytes of space. The partition table is 64 bytes long allowing up to 4 partitions to be created (4*16 = 64). Dump your disk MBR into a file using MBRUtils. Search in Google and you will find it. Then create your own partition. The partition structure is:
Code:
(* ----------------------------------- *)
PHDDPartition = ^THDDPartition;
THDDPartition = Packed Record
BootIndicator : Byte;
StartingCHS : Array [0..2] of Byte;
PartitionType : Byte;
EndingCHS : Array [0..2] of Byte;
StartingLBA : DWORD;
PartitionSizeInSectors : DWORD;
end;
(* ----------------------------------- *)
If you find the BootIndicator field of one of the partitions to be equal to 0x80, that partition is the active partition and most definitely your Windows partition. Find its length and see how many bytes you have free for your own partition and etc. Then create one of the above structures and write it to a new partition in your partition table.
Now i just need to know how to Write my bin files to the hard drive. Do i have to make a disk image? if so what kind? What tool? Or do i put the bins directly on drive?
-
- Member
- Posts: 79
- Joined: Sun Jun 10, 2007 11:36 am