Page 1 of 2

Writing Kernel to hard drive

Posted: Sat Jan 12, 2008 8:13 pm
by djtrickdog
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.

Posted: Sat Jan 12, 2008 8:24 pm
by Pyrofan1
create a new partition and put it on there.

Posted: Sat Jan 12, 2008 10:03 pm
by djtrickdog
Pyrofan1 wrote:create a new partition and put it on there.
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.

Posted: Sun Jan 13, 2008 12:42 am
by Jef
djtrickdog wrote:
Pyrofan1 wrote:create a new partition and put it on there.
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.
you don't know how to create a partition (?) or you don't know how to put it there your kernel?

Posted: Sun Jan 13, 2008 2:14 am
by djtrickdog
not with xp no (linux, yus, have no linux right now). and writing kernel with it, no

Posted: Sun Jan 13, 2008 4:11 am
by binutils
http://gparted.sourceforge.net/

HTH

--
PS: too bad, winxp first before linux, plan9 etc..

Posted: Sun Jan 13, 2008 5:11 am
by JamesM
1) $linux_distro liveCD.
2) right click my computer -> manage -> drives ... I think you can double click some free space there and make a new partition
3) cygwin -> dd / fdisk

* NOTE if you are resizing an NTFS partition don't forget to pray first...

Posted: Sun Jan 13, 2008 8:40 am
by mathematician
It your BIOS gives you the option of booting up from a hard drive other than the master on the primary IDE channel you could go to Ebay, buy a cheapo 40GB drive for £15 or so, and use that exclusively for OS testing.

Posted: Sun Jan 13, 2008 11:16 am
by djtrickdog
So the only way is linux? :? dang windows
ok i have ubuntu live cd i could just use that. thanks for help

Posted: Sun Jan 13, 2008 4:09 pm
by bewing
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.

Posted: Sun Jan 13, 2008 11:51 pm
by Dex
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.

Posted: Mon Jan 14, 2008 5:08 am
by JamesM
djtrickdog wrote:So the only way is linux? :? dang windows
ok i have ubuntu live cd i could just use that. thanks for help
Bah! Read my post!
JamesM wrote:2) right click my computer -> manage -> drives ... I think you can double click some free space there and make a new partition
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.

Re: Writing Kernel to hard drive

Posted: Mon Jan 14, 2008 5:21 am
by XCHG
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.
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: 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;
(* ----------------------------------- *)
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.

Let me know if you need more help.

Posted: Mon Jan 14, 2008 11:49 pm
by djtrickdog
Bah! Read my post!
oops sorry misunderstood what you ment.
what is dd? i googled and not sure i found the right thing...
i also searched on wiki
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.
i just created a new partition...thanks for the help!
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?

Posted: Tue Jan 15, 2008 12:45 am
by ChristianF
MMhhh....
you can ...
  • ... install GRUB
    ... modify the boot.ini
To modify the boot.ini click on start, execute, type msconfig and change to boot.ini. There you can insert your OS.

Cheers
Christian