LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   running linux in dosbox (https://www.linuxquestions.org/questions/linux-newbie-8/running-linux-in-dosbox-762454/)

smeezekitty 10-16-2009 03:37 PM

running linux in dosbox
 
i have no clue how to do it because dosbox does not emulate an IDE controller and i dont know how to boot linux from a ramdisk
it stops booting at the mounting filesystem -- is there anyway to have root-in-ram just to see if i could get to bash?

XavierP 10-16-2009 04:09 PM

Dosbox is a dos environment to enable you to run DOS games and programs. Linux does not use DOS. Just use a Virtual Machine.

smeezekitty 10-16-2009 04:11 PM

i am doing it because i can not because i want to use it as a guest os

XavierP 10-16-2009 04:17 PM

You say you're doing it because you can, but you don't know how to do it? Linux will not run in DOS or dosbox. This is why the Linux install makes you reformat the partition or drive to a non FAT16/32 or NTFS drive - Linux is not designed to rn in DOS.

wmakowski 10-16-2009 04:29 PM

Essentially that is what initrd (initial ram disk) is all about. The kernel creates a ramdisk and loads a root filesystem from the contents of an initrd file. Initrd files are created using cpio and gzip. You can extract one and then modify its contents. You'll see an init script in there written using nash. See man initrd or nash for specifics. I'm sure someone has written a howto out there on the net somewhere.

----
Bill

wmakowski 10-16-2009 04:34 PM

Another thing I just remembered from the early days. You'll like this XavierP. Check out Monkey Linux. Monkey Linux is a minimal Linux ELF distribution in a 7.5 MB archive (5 diskettes) Monkey Linux can be extracted to the DOS filesystem (to the FAT32 too). This is pretty old stuff so it might not work with your hardware though.

----
Bill

XavierP 10-16-2009 06:06 PM

Dosbox is not an entire OS though. It's not even DOS so running anything other than DOS programs would be problematic at least. Monkey does look cool, thanks for that. I can't see the point of running Linux within a DOS emulator though. Surely a VM would be a far more useful learning tool?

smeezekitty 10-16-2009 07:13 PM

basically the question is how do i use a ram disk as the root

smeezekitty 10-17-2009 07:27 PM

still wondering how do i use a ram disk as root

colorpurple21859 10-17-2009 07:47 PM

add this to the kernel line: ramdisk_size=166500 root=/dev/ram0

smeezekitty 10-17-2009 08:03 PM

i get
Kernel Panic: VFS: Unable to mount root fs on 01:00

wmakowski 10-19-2009 10:18 AM

I don't know if what you are doing is possible, but you might want to re-read post #5. Especially the part about initrd and nash. When the kernel loads the last thing it does is execute init. init is the mother of all processes. init is a script within your initrd image. What normally happens at the end of init is that it will try to switchroot from ram to a physical device. Once it has root loaded it will continue starting up all the processes/services for that particular runlevel. You'll need to modify init so it stays in your initial ram disk. If you want to execute anything you'll also need to add those items to the filesystem in initrd. There might be a way to do that after, but I've never tried it.

inclusivedisjunction 10-26-2009 03:46 AM

Hi smeezekitty. If you're wondering, I've already tried a couple distros with ramdisks. They all crash DOSBox as soon as they try to launch init. My guess is they throw an exception that crashes the machine; maybe the FPU emulation is borked? You might want to try enabling 387 emulation if the kernel you use supports it (add no387 to the kernel parameters).


All times are GMT -5. The time now is 08:26 AM.