Someone help(Linux)

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
Eponick

Someone help(Linux)

Post by Eponick »

Ive been trying a couple days now can I cant figure out how to put the bootsector and a kernel into an image.
Ive tried:
dd if=BOOTF.bin of=/dev/fd0
cp kernel.bin /mnt/floppy
dd if=/dev/fd0 of=image.img

Then running the img in VMWare
But it just hangs at startup.
Can someone please help?
Jamethiel

RE:Someone help(Linux)

Post by Jamethiel »

So, let me get this straight... You are neither mounting nor unmounting the floppy disk filesystem, and you just expect it to work?

You need to mount the floppy disk to /mnt/floppy before copying the kernel in, and unmount it before taking the image.
Legend

RE:Someone help(Linux)

Post by Legend »

The boot sector should be where it should be anyway.
But the kernel might be somewhere on your harddrive then ;)
And can your boot sector handle the filesystem?
Eponick

RE:Someone help(Linux)

Post by Eponick »

I finaly got GRUB to work, but it keeps saying it cant use the kernel, unknown file type or something. Im compiling it into binary but its just not working.
I cant get the sample kernel to compile correct either.
Can someone tell me the args to use for GCC and LD?
VE3MTM

RE:Someone help(Linux)

Post by VE3MTM »

There are many tutorials out there for how to do all of this.

If you're using Linux as your development platform, you *need* to know how it works and how to do all the tasks you'll need (creating and writing images to a block device is one such task).

To get your OS to boot from GRUB, it has to be multiboot-compliant. Normally, you'll give GRUB an ELF image, but it can handle binary images if they are multiboot-compliant.

There are no args to use for GCC and LD that everyone needs. I put lots of -W flags (namely -Werror -Wall, because I don't like things wrong with my code) on GCC, and I use a linker script for LD that does everything I need. You'll likely have something different.

In short, RTFM
Post Reply