Skip to content

Live-bootstrap does not work on hard drive but does on ram drive #27

Description

@rick-masters

I am using a kernel which can be built this way:

git clone https://github.com/rick-masters/fiwix fiwix-1.4.0-lb-73f4c28
cd fiwix-1.4.0-lb-73f4c28
git checkout fiwix-1.4.0-lb-73f4c28
make CONFFLAGS="-DCONFIG_MMAP2 -DCONFIG_64BIT_SYSCALLS -DNR_PROCS=4096 -DCHILD_MAX=4096 -DOPEN_MAX=1536 -DNR_OPENS=1536 -DDEFAULT_ROOT_FLAGS=0 -DINIT_PROGRAM=\"\\\"/init\\\"\" -DUTS_SYSNAME=\"\\\"Linux\\\"\""

By the way, this is a fork based on your commit 73f4c28 from March 22, 2023. This is the most recent commit that I was able to get working with my changes. If I include the next commit 58ca771 then live-bootstrap fails with page faults in the cp command. I'm looking into that but for now I am unable to provide a fork based on the latest code. However, most of your recent ATA/PCI changes are in the fork I have provided.

With that, testing with hard drive does not work:

git clone https://github.com/rick-masters/live-bootstrap
cd live-bootstrap
git checkout kernel-bootstrap-v2-fiwix
git submodule update --init --recursive
cp ~/fiwix-1.4.0-lb-73f4c28/fiwix ./kernel
./rootfs.py --qemu --kernel kernel --kernel-fiwix-hd

The hard drive variation fails in various ways. Usually it is a lockup but it may also be a page fault or qemu may simply exit for an unknown reason.

Testing with ram drive does work:

git clone https://github.com/rick-masters/live-bootstrap
cd live-bootstrap
git checkout kernel-bootstrap-v2-fiwix
git submodule update --init --recursive
cp ~/fiwix-1.4.0-lb-73f4c28/fiwix ./kernel
./rootfs.py --qemu --kernel kernel --kernel-fiwix-rd

A successful run ends after Linux has been compiled and there is a mount error "Only root can do that". This is a normal ending for Fiwix because Fiwix cannot perform a Linux kexec.

I should note that for both cases there may be a long delay (about a minute) after the "Booting from ROM..." message is displayed. I am not sure why there is a delay and it may depend on your version of qemu but it does start eventually. This delay is an unrelated problem.

For hard drive testing, A difference in behavior can be produced by changing include/fiwix/ata.h:

From this:

#define WAIT_FOR_DISK   (1 * HZ)

To this:

#define WAIT_FOR_DISK   (100 * HZ)

This change will improve the failure rate from 100% to 15% for me. It may appear to work but it does fail regularly so this is not a full solution. For me this change also causes a startup delay for Fiwix of over 6 minutes!

Some information on live-bootstrap may be helpful. Fundamentally live-bootstrap is just creating a drive image and then launching qemu. The scripts that launch qemu are named bootfiwix-rd and bootfiwix-hd and can be found in the root of the live-bootstrap repository. The ram drive and hard drive variations use the exact same ext2 file system. The only difference is that with the hard drive method an MBR with partition table and some padding sectors are prepended to the file system and the qemu options are different.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions