How to insert the ram disk image to a FreeBSD kernel?

Hi, Guys

As i know, it is easy to insert a ram disk image into a NetBSD kernel image.

say :

Code:
makefs -s 20m -t ffs ramdisk.img fakeroot/
mdsetimage -v netbsd ramdisk.img

Is this possible in FreeBSD and how ?

Thanks in advance.
 
wsw1wsw2 said:
These are memory disks(filesystem) support in FreeBSD. But i want to know is there a way to insert a memory disk as root file system to a FreeBSD kernel?

You can for sure put memory disk (even compressed) on the medium along with the kernel, and boot it as a / filesystem, but I havent heard about putting it into the kernel (many FreeBSD LiveCD's work like that).

BTW, you got some more info/links on the sollution you mentioned? About ramdisk in NetBSD kernel and pros/cons of that sollution?
 
vermaden said:
BTW, you got some more info/links on the sollution you mentioned? About ramdisk in NetBSD kernel and pros/cons of that sollution?
Here are some:

Introduction

The purpose of this document is to guide you to create a RAM disk image and a custom kernel in order to boot your mini NetBSD off a Compact Flash or use it to debug it in an emulated environment, such as qemu.

The ramdisk image will have to be inserted into your kernel and then extracted to memory of your embedded device (or your emulator) and used as the root file system, which then can be used by your kernel as if it resided on a "normal" storage media like a hard drive.
...
http://wiki.netbsd.se/How_to_create_bootable_NetBSD_image
http://brianrose.net/family/fetch.php?dir=/Brian/NetBSD/Embedded&filename=single.html

And also man page of mdsetimage(8), which is not very descriptive though. :)
 
s0xxx said:
And also man page of mdsetimage(8), which is not very descriptive though. :)

By reading the mdsetimage's source code, the ramdisk image insert into the kernel's some ELF section.

NetBSD kernel can be configured to work with multiboot boot loader such as grub. So we can get a single ELF file (kernel with ramdisk root filesystem in it) to boot up a computer runing a complete NetBSD system. (with enough memory)

i think FreeBSD can not do that.
 
man loader

Code:
boot_dfltroot
               Instructs the kernel to mount the statically compiled-in root
               file system.

I have no idea how to get it in there, been wondering the same myself.

James
 
Back
Top