Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: alex on March 26, 2009, 11:10:34 AM

Title: Tinycorelinux Qemu Embedded
Post by: alex on March 26, 2009, 11:10:34 AM
Hi:

It would be great if RobertS adapts the DSL Embedded files to Tinycorelinux.

I'm trying to run tinycore from a pendrive and boot either
natively or from within Windows.

I'm trying to follow Roberts's DSL Embedded quide but I had no sucess with Qemu.

I have two questions:

1) which options do I have to include in qemu in order to boot with BzImage and tinycore.gz files AND have persistancy the same way as booting natively

tried :

qemu.exe -L . -m 384 -kernel bZImage -initrd tinycore.gz -append "vga=791 quiet"

qemu.exe, bZimge and tinycore.gz are in the same directory

but no sucess with booting

2) is there any option to pass to tinycore when booting natively in order to recognize a virtual hd (in DSL was restore=harddisk , where harddisk is the name of the virtual disk image).

I'm a linux and english language newbee so please apologies.

Regards, and keep the good work!



Title: Re: Tinycorelinux Qemu Embedded
Post by: Lee on March 26, 2009, 12:32:09 PM
Hi Alex,

I have been using TC in Qemu on Win XP pretty painlessly like this:

1) Download & install qemu
Code: [Select]
http://www.h6.dion.ne.jp/~kazuw/qemu-win/qemu-0.9.0-windows.zip
2) Modify qemu-win.bat  as follows:
Code: [Select]
@ECHO OFF
REM Start qemu on windows.

REM SDL_VIDEODRIVER=directx is faster than windib. But keyboard cannot work well.
SET SDL_VIDEODRIVER=windib

REM SDL_AUDIODRIVER=waveout or dsound can be used. Only if QEMU_AUDIO_DRV=sdl.
SET SDL_AUDIODRIVER=dsound

REM QEMU_AUDIO_DRV=dsound or fmod or sdl or none can be used. See qemu -audio-help.
SET QEMU_AUDIO_DRV=dsound

REM QEMU_AUDIO_LOG_TO_MONITOR=1 displays log messages in QEMU monitor.
SET QEMU_AUDIO_LOG_TO_MONITOR=0

REM PCI-based PC(default): -M pc
REM ISA-based PC         : -M isapc
REM -M isapc is added for NE2000 ISA card.

IF x%1x == xx GOTO NOARG

IF EXIST %1 GOTO LOAD

:BADARG
  ECHO %1 not found.  Please specify one of the following:
  DIR *.iso
  GOTO END

:NOARG
  ECHO No system specified.  Please specify one of the following:
  DIR /b *.iso
  ECHO.
  PAUSE
  GOTO END

:LOAD
  REM qemu.exe -L . -m 64 -hda /dev/sda -soundhw all -localtime -M isapc
  qemu.exe -L . -m 128 -cdrom %1 -boot d -hda \\.\PhysicalDrive0
  GOTO END

:END

3) Make a shortcut to qemu-win.bat

4) Download the latest TC iso to the qemu directory

5) To run it, simply drag the TC iso and drop it onto the qemu-win.bat shortcut.  For some reason this process is referred to as "dragon droppings", or something like that.

You might want to modify your qemu-win.bat for safety - do away with
Code: [Select]
-hda \\.\PhysicalDrive0
or to change the allocated memory - modify
Code: [Select]
-m 128
Title: Re: Tinycorelinux Qemu Embedded
Post by: alex on March 27, 2009, 10:40:24 AM
Hi Lee:

Thank you for your response.

I'm afraid that the option -hda \\.\PhysicalDrive0 will not work since I don't have administrator right's in my PC.

What I'm looking is to have persistancy in my USB flash having launched Qemu.

I'll keep trying to adapt the DSL Embedded *.bat files

Regards,

Alex.
Title: Re: Tinycorelinux Qemu Embedded
Post by: roberts on March 27, 2009, 10:50:17 AM
Sorry, I no longer run or have access to any Windows OS.
Title: Re: Tinycorelinux Qemu Embedded
Post by: tobiaus on March 27, 2009, 01:13:24 PM
What I'm looking is to have persistancy in my USB flash having launched Qemu.

getting tc running in qemu is easy, just use qemu [any special items you want like -m 128 ... although qemu uses 128 anyway] -boot d -cdrom drive:\path\tinycoreimage.iso [then instead of -hda etc use -hda usbdriveletter:\path\qemuvirtualimage, where virtualimage is a blank image you've created, or! one you created for dsl.]
Title: Re: Tinycorelinux Qemu Embedded
Post by: Lee on March 27, 2009, 01:47:22 PM
qemu-doc.html, section 3.9.1, in the qemu directory, left me doubting whether I could access a USB flash drive from qemu, but I thought, "Hmm, windows just thinks its another disk drive", so...

Code: [Select]
-hda \\.\PhysicalDrive1
(my system has only one actual hard disk, (PhysicalDrive0, in this context), so perhaps the USB stick is PhysicalDrive1.  Sure enough, that works -BUT-...

1) TC bitched about a problem on hda5 (my USB stick is 4GB partitioned as hda1=Primary/fat32/2GB and hda2=extended/2GB w/hda5=logical/ext2/2GB)
I didn't mess with hda5 at all.

2) Changes written to hda1 were not visible in windows until I physically removed and reinserted the USB stick, which I did after
  a: unmounting the filesystem in TC (changes still not visible to Windows)
  b: shutting down TC and qemu (changes still not visible to Windows)
  c: using View / Refresh in Windows explorer (changes still not visible to Windows)
After reinserting the USB stick, the files looked fine (as far as I can tell) in Windows.

The moral of the story - this looks like it works, but you want to test -thoroughly- on a scrap filesystem before trusting this setup.
Title: Re: Tinycorelinux Qemu Embedded
Post by: alex on March 27, 2009, 05:01:58 PM
tobiaus:

I'll try the virtual image method.

I had sucess with this qemu options and restored tce extensions and my settings from the FAT32 formatted pendrive.

Code: [Select]
-hdb fat:%BatchPath% -append "vga=785 quiet tce=hdb1 restore=hdb1"
Lee:

I'll see if I can write to the pendrive with the virtual fat method (see above).

Thank you for your help!
Title: Re: Tinycorelinux Qemu Embedded
Post by: libertyernie on March 30, 2009, 07:02:29 PM
It would be relatively easy to make a small hard disk image with SYSLINUX to boot in QEMU, even if you don't have access to Windows. It wouldn't boot natively, but it would run in user-mode with persistence.
Title: Re: Tinycorelinux Qemu Embedded
Post by: alex on April 03, 2009, 11:27:10 AM
tobiaus:

Quote
getting tc running in qemu is easy, just use qemu [any special items you want like -m 128 ... although qemu uses 128 anyway] -boot d -cdrom drive:\path\tinycoreimage.iso [then instead of -hda etc use -hda usbdriveletter:\path\qemuvirtualimage, where virtualimage is a blank image you've created, or! one you created for dsl.]

Now, in order to share the virtual image for Qemu with natively booted Tinycorelinux, is there a boot option to use the virtualimage (in my case is Tiny.img)?. DSL uses :

Code: [Select]
boot: dsl qemu restore=virtualimage
Regards,

alex
Title: Re: Tinycorelinux Qemu Embedded
Post by: tobiaus on April 03, 2009, 07:50:20 PM
qemu ought to see it as just another drive. try restore=sda1 tce=sda1 or, restore=hda1 tce=hda1
Title: Re: Tinycorelinux Qemu Embedded
Post by: alex on April 03, 2009, 08:20:32 PM
In qemu is ok, but my question is when booting in bare metal (natively).
Title: Re: Tinycorelinux Qemu Embedded
Post by: tobiaus on April 04, 2009, 04:30:37 AM
In qemu is ok, but my question is when booting in bare metal (natively).

dsl can use the virtual image even if it's not in qemu? i must have read that but not noticed. i don't know if there's a way to make tc do that yet.
Title: Re: Tinycorelinux Qemu Embedded
Post by: alex on April 06, 2009, 05:26:47 PM
That's right. This is from the  DSL Qemu Embedded and Native Instructions:

Quote
Using Qemu Virtual Harddrive from natively booted DSL...
When booting the pendrive natively use the following to share
virtual drive.

boot: dsl qemu frugal restore=harddisk mydsl=harddisk/mydsl

Maybe roberts remembers if there was a special customization to DSL boot parameters to achieve that.

alex.
Title: Re: Tinycorelinux Qemu Embedded
Post by: roberts on April 06, 2009, 10:06:38 PM
There was/is so many ways to boot qemu, iso, img, and -kernel -initrd

I just tried this on Tiny Core embedded in Tiny Core using the virtual disk, as I had setup in DSL, i.e., -kernel -initrd option
.
It works without the need for any special "qemu" boot parameter in Tiny Core.

The virtual drive is just an ext2 loop file.

My qemu startup is:

qemu -no-kqemu -m 256 -kernel bzImage -initrd tinycore.gz -hdb harddisk -append "quiet noscsi ide1=noprobe ide2=noprobe nomce tce=hdb restore=hdb"

This is where all of my files are on a pendrive
bzImage
tinycore.gz
tce/
mydata.tgz

The backup/restore and tce saving/loading upon boot all worked as expected.

HTH
Title: Re: Tinycorelinux Qemu Embedded
Post by: alex on April 15, 2009, 09:25:38 AM
roberts, thank you for your response.

May be I didn't express myself clear. What I mean now is native boot.

On the boot prompt I put:

Code: [Select]
boot: tinycore tce=sda1/my/path/to/harddisk
where harddisk is a virtual disk created with qemu-img but no success in mounting it at boot.

Sorrry for my english,

alex.
Title: Re: Tinycorelinux Qemu Embedded
Post by: alex on April 18, 2009, 08:23:13 AM
Hi:

I tried the harddisk.img (virtual HD) under qemu in a windows host and works fine.

Now at home I don“t use windows and at the moment have no success to mount the same virtual HD at boot. Inside the VHD I have de backup file and /tce directory.

Is there any patch to do to bzimage or the kernel in order to make TC accept a special cheatcode at boot and recognize the VHD as hdb for example?

Thank you,

Alex
Title: Re: Tinycorelinux Qemu Embedded
Post by: roberts on April 18, 2009, 07:39:01 PM
OK. I see. I will plan to implement it.
Title: Re: Tinycorelinux Qemu Embedded
Post by: alex on April 18, 2009, 09:34:53 PM
thank you for your response roberts.

It would be great to have TC as a portable desktop across linux and windows.

alex.

Title: Re: Tinycorelinux Qemu Embedded
Post by: alex on April 21, 2009, 09:24:38 AM
In the new release 1.4rc1 I had to add the extension ".img" to harddisk

Code: [Select]
boot: tinycore waitusb=10 tcvd=harddisk.img tce=tcvd restore=tcvd
otherwise it gives an "invalid device tcvd" error

thanks!

alex
Title: Re: Tinycorelinux Qemu Embedded
Post by: roberts on April 21, 2009, 12:21:54 PM
Yes, you use the exact name of your image file. On mine, I did not use the .img extension.