Writing Kernel 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.
User avatar
djtrickdog
Member
Member
Posts: 39
Joined: Sat Dec 15, 2007 7:36 pm

Post by djtrickdog »

OdinPG wrote: There you can insert your OS.
?
i know how to edit the boot.ini, i had to rebuild it because of corruption once. But how would i go about writing my part with my kernel?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

what is dd? i googled and not sure i found the right thing...
The man pages for dd wrote:NAME
dd - convert and copy a file

SYNOPSIS
dd [OPERAND]...
dd OPTION

DESCRIPTION
Copy a file, converting and formatting according to the operands.

bs=BYTES
force ibs=BYTES and obs=BYTES

cbs=BYTES
convert BYTES bytes at a time

conv=CONVS
convert the file as per the comma separated symbol list

count=BLOCKS
copy only BLOCKS input blocks
ibs=BYTES
read BYTES bytes at a time

if=FILE
read from FILE instead of stdin

iflag=FLAGS
read as per the comma separated symbol list

obs=BYTES
write BYTES bytes at a time

of=FILE
write to FILE instead of stdout

oflag=FLAGS
write as per the comma separated symbol list

seek=BLOCKS
skip BLOCKS obs-sized blocks at start of output

...
User avatar
djtrickdog
Member
Member
Posts: 39
Joined: Sat Dec 15, 2007 7:36 pm

Post by djtrickdog »

oh...so it is a unix operation. Hmm which Unix/Linux OS should i install? I had ubuntu, should i stick with it?
i know how to edit the boot.ini, i had to rebuild it because of corruption once. But how would i go about writing my part with my kernel?
User avatar
binutils
Member
Member
Posts: 214
Joined: Thu Apr 05, 2007 6:07 am

Post by binutils »

Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post by Tyler »

djtrickdog wrote:oh...so it is a unix operation. Hmm which Unix/Linux OS should i install? I had ubuntu, should i stick with it?
Or you could use Cygwin... or use the built in Windows ability to do it... or use a Windows Equivalent (at least for this operation) of dd, like John Fine's partcopy.
User avatar
djtrickdog
Member
Member
Posts: 39
Joined: Sat Dec 15, 2007 7:36 pm

Post by djtrickdog »

Tyler wrote:
djtrickdog wrote:oh...so it is a unix operation. Hmm which Unix/Linux OS should i install? I had ubuntu, should i stick with it?
Or you could use Cygwin... or use the built in Windows ability to do it... or use a Windows Equivalent (at least for this operation) of dd, like John Fine's partcopy.
I have partcopy put i dont know how to write to the partition i created on same hard drive without destroying my windows :P

binutils:
I tried using dd and i use the command (F is my empty drive)
dd if=mikeos.flp of=\\.\f:
It gives me an error on output being used.
Jeffrey
Posts: 20
Joined: Fri Jul 27, 2007 1:35 pm
Location: Virginia, USA

Post by Jeffrey »

dd is a unix file utility.

check out this description. it's a dd man file dump.
http://www.scit.wlv.ac.uk/cgi-bin/mansec?1M+dd

It can be used to create raw disk images that you can mount in *nix systems.

And thinking about your problem, it seems to me that you are going way out of your way to write an OS. Why do you need to write it to the harddisk to begin with? You are going to be doing a lot of rebooting your machine if you do it that way. So why not go with a virtual machine such as bochs, qemu, virtual box? You need to restart all you have to do is restart the virtual machine.

[EDIT: Sorry, didn't see the second page of posts. Forget this reply]
User avatar
djtrickdog
Member
Member
Posts: 39
Joined: Sat Dec 15, 2007 7:36 pm

Post by djtrickdog »

And thinking about your problem, it seems to me that you are going way out of your way to write an OS. Why do you need to write it to the harddisk to begin with? You are going to be doing a lot of rebooting your machine if you do it that way. So why not go with a virtual machine such as bochs, qemu, virtual box? You need to restart all you have to do is restart the virtual machine.
I have emulators but it sometimes isnt the same feeling. Or am i just wierd???

Oh and another thing, i use Winimage to make my ima files right to boot from Qemu...well i tried throwing all my bins into a ima then booted in qemu and i get an error right after the boot message comes up (default says "Made with Winimage blah blah blah...) well the error says cannot boot from disk or something like that :? i thought maybe it had to do with my code but i opened the original floppy image that comes packed with mikeos and it boots but when i extract the bins then repack in a ima file it gets same error
User avatar
binutils
Member
Member
Posts: 214
Joined: Thu Apr 05, 2007 6:07 am

Post by binutils »

djtrickdog wrote: I tried using dd and i use the command (F is my empty drive)
dd if=mikeos.flp of=\\.\f:
It gives me an error on output being used.
my tip indicated only your f drive is usb and the image is maden for usb drive.
maybe to see the source of dd give you some hint.

http://www.chrysocome.net/downloads/dd-0.6beta1.src.zip
User avatar
djtrickdog
Member
Member
Posts: 39
Joined: Sat Dec 15, 2007 7:36 pm

Post by djtrickdog »

binutils wrote:
djtrickdog wrote: I tried using dd and i use the command (F is my empty drive)
dd if=mikeos.flp of=\\.\f:
It gives me an error on output being used.
my tip indicated only your f drive is usb and the image is maden for usb drive.
maybe to see the source of dd give you some hint.

http://www.chrysocome.net/downloads/dd-0.6beta1.src.zip
hmm that sounds like a good idea... illlook at that
User avatar
djtrickdog
Member
Member
Posts: 39
Joined: Sat Dec 15, 2007 7:36 pm

Post by djtrickdog »

Oh and another thing, i use Winimage to make my ima files right to boot from Qemu...well i tried throwing all my bins into a ima then booted in qemu and i get an error right after the boot message comes up (default says "Made with Winimage blah blah blah...) well the error says cannot boot from disk or something like that Confused i thought maybe it had to do with my code but i opened the original floppy image that comes packed with mikeos and it boots but when i extract the bins then repack in a ima file it gets same error
Post Reply