Showing posts with label kernel. Show all posts
Showing posts with label kernel. Show all posts

Monday, May 28, 2007

emulate floppy in linux

So I was trying to write a "hello world" "OS" and then add more functionality to it.. just to try it out.

My colleague had showed me a nice link osdev.org. quite intersting resource regarding os development. There they had tutorials on how to get started.

I found this to be a very nice link to get me started:
http://www.osdever.net/downloads.php

One of the steps involved making a boot floppy with grub etc installed on it. Now I was using vmware and didnt hava floppy drive. So I knew I could use dd to create an image and then change the image's filesystem. Just didnt konw how exactly. So my co-worker gave this!

# create a image of Zeros of length 2048 bytes
dd if=/dev/zero of=floppy.img bs=1024 count=2048

#make the image of ext2 file system
mkfs.ext2 floppy.img

#create a mount point
mkdir floppy.d

#mount the image to the mount point
mount -o loop floppy.img floppy.d


Now you can treat the floppy.d directory as a floppy drive! and then unmount when done and transfer the image anywhere!



works like a charm :)







Wednesday, December 13, 2006

kernel woos

Alright, so I have compiled the linux kernel 32485902483 times, and failed. Big deal! So I took it upon my hands to explore this uncharted territory that I've always feared.
Okay now I am too bored to continue giving a background and how I sucked at that for last 3 years. Lets jump right to the point.

The problems I faced and solutions are below. All though you can search the same error string on google and get the same results that i am posting (thats what I did :)).

linux 2.6.19:
error: kernel panic saying "enforcing enabled but no policies"
fix: disable enforcing. add enforcing=0 in /boot/grub/grub.conf at the end of the line "kernel..."

linux 2.6.9:
kernel panic:
Cannot open root device "LABEL=/" or unknown-block(0,0)

fix: this has lots of fixes covered at
http://www.linuxquestions.org/questions/showthread.php?t=269230
What worked for me was increasing my block dev ramsize! Apparently sometimes ramdisk is too small for initrd to fit in (or so I understand). So solution,
grep BLK_DEV_RAM /usr/src/linux/.config
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=8192

Add the above 2 lines to your kernel config.