WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Tinycorelinux Qemu Embedded  (Read 15989 times)

Offline alex

  • Newbie
  • *
  • Posts: 40
Tinycorelinux Qemu Embedded
« 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!




Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Tinycorelinux Qemu Embedded
« Reply #1 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
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline alex

  • Newbie
  • *
  • Posts: 40
Re: Tinycorelinux Qemu Embedded
« Reply #2 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.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Tinycorelinux Qemu Embedded
« Reply #3 on: March 27, 2009, 10:50:17 AM »
Sorry, I no longer run or have access to any Windows OS.
10+ Years Contributing to Linux Open Source Projects.

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: Tinycorelinux Qemu Embedded
« Reply #4 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.]

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Tinycorelinux Qemu Embedded
« Reply #5 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.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline alex

  • Newbie
  • *
  • Posts: 40
Re: Tinycorelinux Qemu Embedded
« Reply #6 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!

Offline libertyernie

  • Newbie
  • *
  • Posts: 11
Re: Tinycorelinux Qemu Embedded
« Reply #7 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.

Offline alex

  • Newbie
  • *
  • Posts: 40
Re: Tinycorelinux Qemu Embedded
« Reply #8 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

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: Tinycorelinux Qemu Embedded
« Reply #9 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

Offline alex

  • Newbie
  • *
  • Posts: 40
Re: Tinycorelinux Qemu Embedded
« Reply #10 on: April 03, 2009, 08:20:32 PM »
In qemu is ok, but my question is when booting in bare metal (natively).

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: Tinycorelinux Qemu Embedded
« Reply #11 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.

Offline alex

  • Newbie
  • *
  • Posts: 40
Re: Tinycorelinux Qemu Embedded
« Reply #12 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.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Tinycorelinux Qemu Embedded
« Reply #13 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
10+ Years Contributing to Linux Open Source Projects.

Offline alex

  • Newbie
  • *
  • Posts: 40
Re: Tinycorelinux Qemu Embedded
« Reply #14 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.