General TC > Tiny Core on Virtual Machines

Setting up Qemu

(1/7) > >>

nick65go:
FYI: I saw that (in both x86 and x86_64 versions) the exfat.ko.gz is unusually placed in drivers, instead of fs (file system) branch, ex: /modules.gz\modules\lib\modules\6.1.2-tinycore\kernel\drivers\scsi\exfat\.

In qemu (ver 3.1) booting TC14 x86_64 with VIRTIO options, both cdrom and hda, the /cde is not used so Xfbdev is not automatically started, because /dev/vda# is not mounted.

--- Code: ---qemu-system-x86_64 -accel kvm -machine q35 -cpu max -m 128M -vga virtio -kernel vmlinuz64 -initrd MyCore.gz -drive file=MyDVD.iso,if=virtio,media=cdrom,readonly=on,index=1 -drive file=Mydisk.qcow2,if=virtio,media=disk,index=2 -boot c -append "vga=ask nozram noswap root=/ init=/init"
--- End code ---

Maybe I missed some initial driver parameters? because after booting I can mount cdrom from /mnt/vda and hdd-disk from /dev/vdb1. OR from /dev/sr0 an /dev/sda1 if I did not use virtio simulation.

EDIT: maybe is my mistake, /cde folder can be only on booting device, but not on another device.

Rich:
Hi nick65go

--- Quote from: nick65go on February 20, 2023, 06:05:01 AM --- ... EDIT: maybe is my mistake, /cde folder can be only on booting device, but not on another device.
--- End quote ---
I don't think that is true.

tc-config  calls  tce-setup  to load extensions.
tce-setup  contains the following:

--- Code: ---# Finally check for CD Extensions if requested
if [ "$CDE" ]; then
        # Some cd drives are slow - if cde was requested, wait for udev to settle
        [ ! -s /etc/sysconfig/cdroms ] && udevadm settle --timeout 5

        if [ -s /etc/sysconfig/cdroms ]; then
                for DEV in `cat /etc/sysconfig/cdroms`; do
                        process_CD
                done
        fi
fi

# If nothing loaded then also check for pseudo CD, e.g., isohybrid
if [ "$CDE" -a -z "$CDELIST" ]; then
        sleep 5
        DEV="$(autoscan 'cde' 'd')"
        process_CD
fi
--- End code ---
If it doesn't find any CDs, then it scans the rest of the system for a device
containing a  /cde  directory.

In order for that to take place, you need to pass the  cde  boot code. I don't
see  cde  anywhere in your  qemu  command.

nick65go:

--- Quote from: Rich on February 20, 2023, 09:07:15 AM ---In order for that to take place, you need to pass the  cde  boot code. I don't see  cde  anywhere in your  qemu  command.

--- End quote ---
Rich, you spot it! Thank you.
PS: I am in the process to rename the (internal) tc functions and subroutines, replacing abc() with _abc(),
same for tc variables, so iset var=blah become set tc_var=blah; and is also clear (for me) if is a function or a variable, etc.
so is self-documented then, and I "know" that is not an external command from /bin, /usr/bin (and busybox/gnu_tools, toybox). In the process I involuntary "destroyed" some scripts.

nick65go:
For clarity, to do not confuse the audience, I am back to virgin files (vmlinuz, rootfs.gz, modules.gz, *.tcz), so Xvesa for now.
[BUT it is the same small "problem" as with Xfbdev running in both in x86 and x86_64];

I concatenated rootfs.gz + modules.gz into MyCore,gz (because I can not have multiple -initrd parameters in qemu  :( ).
I created sda1.qcow2 file, from linux I formatted as ext2 and mounted [so it has NO PARTITIONS] and I populated its /tce/optional folder with virgin *.tcz and *tcz.dep, and I have /tce/onboot.lst etc.

case 1: booting with "legacy" -hda is working, Xvesa shows up automatically.

--- Code: ---qemu-system-i386.exe -machine q35 -cpu max -m 128M -vga virtio -kernel vmlinuz -initrd Mycore.gz -hda sda1.qcow2
--- End code ---


case 2: booting with "Virtio" vda is NOT working by default, only manually.

--- Code: ---qemu-system-i386.exe -machine q35 -cpu max -m 128M -vga virtio -kernel vmlinuz -initrd Mycore.gz -drive file=sda1.qcow2,if=virtio,media=disk
--- End code ---

In cat /etc/fstab I have the mount point /mnt/vda mapped to /dev/vda, OK. But the mount command shows that /dev/vda is not mounted yet. So of course tczs are not loaded, and Xvesa is not shown.
I tried even with individual -append cases, like tce=vda, tce=/mnt/vda, tce=/dev/vda etc. No success.  :(

The bug: the virgin scripts are focused MAINLY on strings like sda* but not vda*. This happens with VIRTIO and with sda.qcow2 partitioned or not.

nick65go:

--- Quote from: curaga on February 20, 2023, 12:35:30 PM ---As for virtio disks, it's quite possible some scripts are missing vda* cases.

--- End quote ---
Right! The culprit section may be in /etc/init.d/tc-config ? with booting variable tcvd=something;
but I am rusty with shell variable truncating... I have no success with it like tcvd=/dev/vda/tce.

Today is near no point to simulate old-pseudo-real devices, when Qemu (yes, 3.1  :) ) is so advanced in Virtio everything (blocks, devices, controllers, network-cards, files-share, video, cpu, etc). A trimmed-down kernel with just virtio drivers, eventually built-in, (and possible without spectre mitigations) will be nice to have.

PS: it is just for fun, to remind me the flow: boot-loader -> kernel -> shell (+ libs)  -> udev -> mounts -> login.

Navigation

[0] Message Index

[#] Next page

Go to full version