roelandjansen / pcmos386v501

PC-MOS/386 v5.01 and up, including cdrom driver sources.
GNU General Public License v3.0
418 stars 60 forks source link

Dual boot #40

Closed ghost closed 5 years ago

ghost commented 5 years ago

Anyone have a dual boot DOS/PCMOS working yet? I have DOS installed on C and PCMOS intalled on D. DOS boots when C is the active partition, no problem. But when I FDISK from DOS to set the active partition to D, fdisk swaps C and D, and now the PCMOS D partition becomes C. I think that is a problem, but don't see how it can be fixed. The PCMOS boot just hangs and won't start.

ghost commented 5 years ago

PC-MOS wants to delete all partitions, recreate C and D, then install itself on D. When that is all done, then it tells you to install or restore DOS on C. I did that, then used DOS fdisk to run fdisk /mbr to set the master boot record the way DOS (6.22) likes, and I think that messed things up.

On my next try, I now seem to have a PC-MOS master boot record which asks me for a boot partition number. I put in 2, but it still hangs. The reason I want to set up a dual boot is to boot into DOS and fix things on the PC-MOS partition when it gets messed up and won't boot.

But that's where I'm at now, won't boot.

the-grue commented 5 years ago

For dual boot, I am using a virtualbox VM with a DOS5 disk, a MOS5 disk, and a source code disk. I either add or remove the DOS5 disk when I need DOS. Otherwise, it's just MOS.

I am using DOS 5 because it is around the same technology level/timeframe as MOS 5.

ghost commented 5 years ago

I had a similar approach with VMWARE but it was a hassle, I was looking for a faster way to fix things when my test kernel flops.

the-grue commented 5 years ago

Noted. Might want to try running the boot sector through the debug program then to see if it hard codes the drive letter/number in there somewhere. Looking at the source code for msys.com might shed some light too as that is what is laying down the boot sector.

the-grue commented 5 years ago

Ok, look here in msys.asm:

jrb 03/06/86 mosinit needs to know which disk it was booted from - in particular it needs to know all the bios parameter block information for the disk so it can be passed to the standard block device driver for locating and reading config.sys and command.com therefore - through a happy quirk of fate, when the boot sector transfers to $$mos.sys, the ds register contains the segment address of the start of the boot sector. the bpb for the boot disk begins at offset 11 in that segment. from offset 3 to offset 10 is a string which begins 'TSL '. at offset 28 is the drive number to be used in calling the bios int 13h to read or write sectors these are the elements of the boot sector code and format upon which the $$mos.sys code will depend in order that it can access the boot disk

I believe D would be 4 and C would be 3?

ghost commented 5 years ago

Good idea. But I don't want to get too distracted with that right now. I just want a faster way to fix boot problems. Of course there are snapshots. I'll use that if I can't get PC-MOS dual boot working soon.

andrewbird commented 5 years ago

I believe D would be 4 and C would be 3?

Wouldn't that be 0x80 == C and 0x81 == D, least it is in the VBR at offset 0x3e.

the-grue commented 5 years ago

Yes, correct for position 0x3e. Both my drives show 00 in position 0x1C, which I believe is default drive. So that's probably not the problem then.

ghost commented 5 years ago

I gave up on PC-MOS dual boot for now. I worked out something faster with VMWARE. Using version 8, I created a VM that's Workstation 4.x hardware compatible. I may want to use Bochs debugger later, and they can read 4.x vmdk files, or so they say. We'll see.

With VMWARE 4.x you get no snapshots though! So I made my own copy of the vmdk file and saved it in the parent directory. When things go wrong, I will copy my manual "snapshot" over the bad vmdk.

One thing I like is their BIOS setup. I set the date to 1-1-1981, and it retains a 1981 date across reboots, I don't have to keep fiddling with it.

ghost commented 5 years ago

Not much more to say, closing