Visopsys 0.84 - [NEW INSTRUCTIONS] Init failed while booting as a Virtual Floppy from coreboot/SeaBIOS

General discussion about Visopsys. We'll create more specific forums if the number of posts justifies that.
Post Reply
qmastery
Posts: 17
Joined: Mon Nov 19, 2018 8:48 pm

Visopsys 0.84 - [NEW INSTRUCTIONS] Init failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by qmastery » Sun Jun 16, 2019 8:22 am

Hi Andy! Hope you're doing well. This is a sequel of viewtopic.php?f=3&t=292 thread. Old testing instruction there got broken, so I made a new one for you - much more user friendly! Simply get this archive - https://github.com/informer2016/shr/raw ... pdebug.zip - then unzip ./visopdebug.zip && cd ./visopdebug/ . You'd need just two commands:

Code: Select all

./visopsys.sh ./path_to_a/new_visopsys.img
- to replace a previously added visopsys floppy inside coreboot.rom with some new experimental build, using a ./cbfstool binary . It's pre-built for your convenience, however if you'd like to build it from source by yourself - there's a ./cbfstool.sh script as well as ./downloaded/ directory - cd ./downloaded/util/cbfstool/ && make all

Code: Select all

./qemu.sh
- to run this coreboot.rom in QEMU (although you may need to edit this file if your qemu executable is not "qemu-system-x86_64") . Visopsys floppy is always the first boot entry and will get booted automatically.

Currently I'm getting the following error log at Visopsys 0.84 :

Code: Select all

Error: kernel process:kernelFloppyDriver.c:readWriteSectors(696):
Read/write error: Unknown error
Error:kernel process:kernelDisk.c:realReadWrite(400):
Error -24 reading 1 sectors at 0, disk fd0
Error:kernel process:kernelIdeDriver.c:atapiStartStop(715):
Media changed
Error:kernel process:kernelDisk.c:realReadWrite(400):
Error -24 reading 1 sectors at 0, disk cd0
Error:kernel process:kernelDisk.c:identifyBootDisk(2081):
The boot device could not be identified
Error:kernel process:kernelInitialize.c:kernelInitialize(370):
Disk functions initialization failed
Error:kernel process:kernelMain.c:kernelMain(85):
Initialization failed.  Press any key (or the "reset" button) to reboot.
Here're your last posts from a previous thread with some ideas - viewtopic.php?f=3&t=292&start=10#p1461
I guess what that Fiwix guy did is to create the ramdisk in the bootloader. So the loader would have to pick a memory address, load the entire emulated floppy into it using the usual int13 calls, then pass that address. But we wouldn't want it to do that under normal circumstances, so there has to be some trigger for it. Perhaps with a custom boot sector.

In the past I've been asked on here about some multiboot stuff, and PXE, and I wonder whether these changes would help to enable all of that - booting from a virtual floppy image.

Rather than a custom boot sector I'd probably go with the creation of an empty file in the image, such /ramdisk, that the bootloader could search for, to trigger this behaviour (as it does with /nograph, which forces text mode operation).
If there's anything else I could help with, please let me know

Best regards,
qmastery

User avatar
andymc
Posts: 516
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84 - [NEW INSTRUCTIONS] Init failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by andymc » Mon Jun 17, 2019 9:03 pm

Hi qmastery!

Thanks for the update. You've been very patient, thanks - I know I promised to look at this a while ago. I'm just finishing off a feature for 0.9 now - in the next day or two - and then I will start trying with this. If I can get it to work, I will do a 0.85 release with that as a new feature (otherwise, there might not be any 0.85; I've been stockpiling a few minor patches, but hoping to get to 0.9 first).

Andy

User avatar
andymc
Posts: 516
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84 - [NEW INSTRUCTIONS] Init failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by andymc » Tue Jun 25, 2019 10:38 pm

The feature I've been working on (UTF-8 and wide-character support throughout the OS) the small details are taking me a little bit longer to finish off than I thought (life, 2 small kids, and all that :violin:) but I am still doing this next! :shifty:

qmastery
Posts: 17
Joined: Mon Nov 19, 2018 8:48 pm

Re: Visopsys 0.84 - [NEW INSTRUCTIONS] Init failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by qmastery » Thu Jul 04, 2019 1:49 pm

andymc wrote:
Tue Jun 25, 2019 10:38 pm
The feature I've been working on (UTF-8 and wide-character support throughout the OS) the small details are taking me a little bit longer to finish off than I thought (life, 2 small kids, and all that :violin:) but I am still doing this next! :shifty:
Okay, waiting patiently - and, after you'll do this, I will be happy to test it on a real hardware as a part of this BIOS :dance:

User avatar
andymc
Posts: 516
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84 - [NEW INSTRUCTIONS] Init failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by andymc » Sun Aug 04, 2019 9:10 pm

Alright, I'm finally free to try this. The last bit of UTF-8 work made it obvious (if it wasn't already) that the text editor needed a massive re-write. Text editing is one of those things that's a lot more difficult and complex than it sounds.

I should have some kind of response soon, even if it's mostly just a bunch of questions :-)

User avatar
andymc
Posts: 516
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84 - [NEW INSTRUCTIONS] Init failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by andymc » Sun Aug 04, 2019 10:50 pm

All your stuff works well for me and I'm up and running, so now I'm working on the code part - thanks! The kernel side of things should be fairly straightforward with the existing ramdisk driver, but there's a bit of BIOS OS-loader work to do. That's all in assembler which I (thankfully!) don't have to touch much nowadays, but it's not too big of a task really.

So the current plan is: if there's a file /ramdisk in the boot floppy, the OS loader will load the entire boot medium into RAM, and pass a new kernel parameter to tell the kernel about it. The kernel will create a RAM disk for this memory during initialization, which is treated the same as any physical disk, and the disk initialization code should be able to locate it as the boot disk. That's the theory anyway.

User avatar
andymc
Posts: 516
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84 - [NEW INSTRUCTIONS] Init failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by andymc » Thu Aug 08, 2019 10:40 pm

OK! So this works for me - what do you think?

https://visopsys.org/files/visopsys/vis ... 09-img.zip

I'll need to remove some debugging messages and do some polishing, but I think it's looking good.

qmastery
Posts: 17
Joined: Mon Nov 19, 2018 8:48 pm

Re: Visopsys 0.84 - [NEW INSTRUCTIONS] Init failed while booting as a Virtual Floppy from coreboot/SeaBIOS

Post by qmastery » Mon Aug 12, 2019 3:47 pm

Andy, this is excellent! I just put your new floppy to a coreboot BIOS of G505S laptop - and Visopsys is booting well :bow-yellow: :clap:
Here is a new log:

Code: Select all

Detecting hardware: SATA disk controller Error::kernelSataAhciDriver.c:issueCommand(1404):
Command failed - timeout
Error::kernelSataAhciDriver.c:detectDisks(1587):
Identify device command failed for port 1
Map RAM disk physical 001b7000 to fec01000 size 1474560
Disk trying fd0 looking for 5d4cb4cc
Error:kernel process:kernelFloppyDriver.c:waitOperationComplete(180):
Command timed out
Error:kernel process:kernelFloppyDriver.c:readWriteSectors(566):
Seek error: Unknown error
Error:kernel process:kernelDisk.c:realReadWrite(401):
Error -24 reading 1 sectors at 0, disk fd0
Disk trying fd1 looking for 5d4cb4cc
Error:kernel process:kernelFloppyDriver.c:waitOperationComplete(180):
Command timed out
Error:kernel process:kernelFloppyDriver.c:readWriteSectors(566):
Seek error: Unknown error
Error:kernel process:kernelDisk.c:realReadWrite(401):
Error -24 reading 1 sectors at 0, disk fd1
Disk trying sd0a looking for 5d4cb4cc
Boot sig 00000000
Disk trying rd0 looking for 5d4cb4cc
Boot sig 5d4cb4cc
There Visopsys boots successfully and I could access its' interface.
After some usage a new message may appear:

Code: Select all

Error:logging thread:kernelFilesystemFat.c:getUnusedClusters(1192):
Not enough free space to complete operation
My hard drive got broken recently - so I need to get a new one before I could test the primary features of Visopsys.
Then I could try the disk partitioning and maybe collect some interesting logs in the process! Wish you a great summer, Andy :)

Post Reply