[Coco] [COCO] Putting NitrOS-9 boot track in ROM

Gene Heskett gheskett at wdtv.com
Mon Feb 2 16:51:55 EST 2015


On Monday 02 February 2015 12:02:03 David Ladd did opine
And Gene did reply:
> Gene,
> 
> Your bootlink is a very cool tool for sure :D
> The thing though is I wont be using HDBDOS at all on the volumes I plan
> on booting from.  I looked at the source for bootlink and it does say
> HDBDOS is required. :(
> 
There may be other possibilities, but the way its written right now pretty 
much depends on having the HDBDOS setups initialized on your hard drive, 
above the end of the os9 reservation or partition.  Using my scsi address 
0 drive as an example, it has about 490 megs out of its gigabyte used for 
nitros9.  And it is setup with the size hard coded in the disk basic roms 
at the usual values for those 3 bytes at IRRC $D89a-b-c but double check 
that.  Whatever you find there should be one more that the LSN0's DD.SIZ, 
the first 3 bytes of LSN0 on the hard drive.  This is an offset that is 
added by ***-DOS (I think RGB-DOS does this too) to a disk access, but it 
has an added value obtained in the case of the /sh descriptor (ih in an 
ide system? don't know) where rather than in the machines rom, the WPC and 
OFS values in the descriptor server as the starting point, but then have 
added to that value, the value in the descriptors "stp" *630 (decimal) 
added to the other 3 bytes from the descriptor.  This then points at the 
LSN0 of the virtual floppy assignment on the hard drive, with a valid 
range from 0 to $FF or 255 decimal.

From there it is essentially a floppy disk of the std 35 track SS type.

Using a properly configured /sh descriptor, you can actually run the mb 
script against the /sh drive, and generate a complete bootable floppy 
image on this virtual drive.  In my case the default drive is $80 or 128.

I am sure there are other different schemes favored too, but that is my 
default.  I have alternate os9boot files on 128 and 130, and I can switch 
to them just by running "bootlink 126" and tapping the reset button once.
Yes, there is a boottrack on both 126 and 130, but they are never read 
even from a cold start.  That will load the boottrack from drive128, that 
boot module will then get the address and size of the os9boot file from 
DD.BT and DD.SIZ in the LSN0 of the hard drive, and load THAT bootfile 
even though it doesn't live on the 128 reservation default.

By setting these starting location values into the /sh descriptor, then 
you can, from a nitros9 boot that is small enough to be able to run the 
format command,  increment the stp value in the /sh descriptor, starting 
at say $83 format it, increment it to $84, format it, wash rinse & repeat 
till you get to $FF in the stp, and you will then have about half of those 
vdisks ready for use. I believe that you could start from a drive4 and do 
the same for virtual disks usable for basic stuff, but I've no knowledge 
of out basic handles the math for drives above 9.  Perhaps someone who 
actually uses hdbdos with rsdos can illuminate that?

Do NOT adjust anything but those 3 vars in the /sh descriptor, the math in 
the roms assumes a 35trkSS sized virtual disk, and trying to exceed that 
will just over write the next vdisk above it.

In case the makefile gets it wrong, spend some time studying the 
superdesc.asm file in the repo's level1/modules directory because if it is 
set wrong, you will format the whole drive!  And unless you have a backup 
dsaved out someplace, you will be well and truly hosed.

As you will see from reading that files comments, there are interactions 
there that can and will bite you.

> I also tried os9gen with the -q=bootfile
> Sadly nothing happened other than my device booted from old boot file
> I also tried os9gen with the -q=bootfile /dd
> Sadly this option left a temp file in the root of /dd and system no
> longer booted.

Something wrong, likely in your bootlist. The error will leave a tempboot 
file behind because it is incomplete.  To get an idea which file caused 
the upset, compare the output of an ident -s with the active file list in 
the bootlist file, bearing in mind that ident, at least my version, pukes 
all over itself  when it doesn't find an $87CD as the next 2 bytes after 
the end of the presently being looked at module.

That FWIW my "vfy" will not do, it just keeps reading the file until it 
finds the $87CD, and then verifies that module.

That is also in the repo, at the same link as bootlink. 

Good luck, something I am not having this morning/afternoon.  I woke up to 
find my boot drive had errored out and was read-only. A reboot, with a 
rather lengthy e2fsck session followed, but the reboot was delayed by my 
replacing that bright red sata cable with one that was not bright red.  
That particular die color has a history with me that goes back 45 years, 
to when I was doing a lot of cb radio service and found that the Japanese 
microphone cables with the bright red conductor in them, it was 100% the 
red wire that failed, the copper of what was once a wire could actually be 
shook out of the red insulation onto a white sheet of paper as a powder 
that resembles rust!

So that particular cable is now a black one, and we wait for the other 
shoe to drop...  If its the cable, and the drive remains stable, thats the 
5th red one since I built this box in 2006. The drive itself claims its as 
healthy as a horse, but then reports 13 killer errors recovered from, 
which it did not have a week ago.  Time to make a trip to town and get a 
fresh one I think.  long test running in the back ground and I can read 
that report about 20:40 this evening.

In the meantime, my web page will be down intermittently as I reboot to it 
to see how much of my data I can get copied across and salvage.  Not my 
idea of a fun week ahead as I get all my customized stuff up and running 
on a debian wheezy (7.8) install.

> So what I was hoping to do is actually link the a OS9Boot file of
> choice(that means if I have multiple on the OS-9 volume) I can just
> type "link bootfile".  What I was picturing is having a few custom
> OS9Boot files in the root of the volume.  Depending on which one I
> want I just do the link that file.  Then do a reboot and pow I reboot
> with that os9boot file. With what ever modules I had chosen to be in
> that special.
> 
> Now I know right now the boot_ide only supports booting from a HDBDOS
> virtual drive, but becker, dw3, dw4, CoCoSDC, and WD1773 all boot fine.
>  I just don't want to have to manually dEd the LSN0 to point to my
> custom file when I feel there should be a utility for this.
> 
> Now here are some examples of why this would be useful.
> So lets say I have a few OS9Boot files in the root of /dd
> One boot file is the general purpose use with all drivers need to do
> about everything I could need.
> The I have another boot file that contains vrn and stripped down for
> playing games.
> Then a few others that might be customized for special needs.
> Now lets say I booted with the general purpose one.  Now I want the one
> with vrn.  "link os9bootvrn" now LSN0 points to os9bootvrn.  I do
> reboot and pow now I can cd to my games and start playing.
> 
> So thats the basics.
> The thing is I don't know how to do this yet myself and figured there
> might have been a utility that could do this on the native OS-9 volume
> already. Though really I guess if there are system calls for it should
> be easy to open file get its start sector and its size and then open
> the boot volume and update LSN0 to point to it.  Yes?
> 
> Gene, thank you for letting me know about your tool.  That will help me
> on my IDE based system :D
> 
> +----------+
> 
> |David Ladd|
> 
> +----------+
> 
> On Sun, Feb 1, 2015 at 11:10 PM, Gene Heskett <gheskett at wdtv.com> wrote:
> > On Sunday 01 February 2015 23:26:17 Christopher R. Hawks did opine
> > 
> > And Gene did reply:
> > > On Sun, 1 Feb 2015 21:04:27 -0600
> > > 
> > > David Ladd <davidwladd at gmail.com> wrote:
> > > > Hello everyone,
> > > > 
> > > > I thought I would share something with everyone that I have been
> > > > tinkering with.
> > > > 
> > > > Last night I was thinking about NitrOS-9 in ROM, but not the
> > > > OS9Boot file like the docs normally talk about.  I was actually
> > > > thinking of putting the boot track for the given device into
> > > > ROM.
> > > > 
> > > > The first reason I thought about doing this is saving the 4608
> > > > bytes that is normally locked out of a given volume used for the
> > > > boot track.  So I figured if I put it into ROM I could gain back
> > > > that space.  Plus this might make it a bit easier to just link
> > > > LSN0 to a specific boot file. Here is my test code thus far:
> > > > ------------------------------*bootrom.asm*
> > > > 
> > > >         org     $C000
> > > > 
> > > > START   EQU     *
> > > > 
> > > >         fcc     "DK"
> > > >         lbra    ENTRY
> > > >         fill    $FF,9*256
> > > > 
> > > > ENTRY   EQU     *
> > > > 
> > > >         ldx     #$2600
> > > >         ldu     #BOOTTRK
> > > > 
> > > > LOOP1   ldd     ,u++
> > > > 
> > > >         std     ,x++
> > > >         cmpu    #BOOTEND
> > > >         bne     LOOP1
> > > >         jmp     $2602
> > > > 
> > > > BOOTTRK EQU     *
> > > > 
> > > >         use     boottrack.asm
> > > > 
> > > > BOOTEND EQU     *
> > > > RMSIZE  EQU     BOOTEND-START
> > > > 
> > > >         fill    $39,$2000-RMSIZE
> > > > 
> > > > أ¢â‚¬â€¹
> > > > ------------------------------
> > > > Now to create the boottrack.asm file I use the os9 tool from
> > > > toolshed. Example as follows:
> > > > os9 dump -a kernel_becker >boottrack.asm
> > > > 
> > > > Then you just need to run lwasm on bootrom.asm and it will build
> > > > the ROM image of the boot track you selected.
> > > > 
> > > > Now so far I have tested this with becker, CoCoSDC, EmuDisk, and
> > > > IDE. Becker, CoCoSDC, and EmuDisk work fine no problems.  So far
> > > > I couldn't get IDE to work.  I will have to examine the source
> > > > code for boot_ide.asm to see how it works more closely.
> > > > 
> > > > Now the only problem I have ran into thus far is a easy way to
> > > > update the OS9Boot file on a pre-existing volume without writing
> > > > a boot track to the volume.  So far os9gen and cobbler both
> > > > require writing a boot track to the volume.
> > > > 
> > > > What I would like to know if anyone has run across a native
> > > > OS-9/NitrOS-9 utility that will link a file as being the OS9Boot
> > > > file to the information that would need to be set in LSN0?
> > > > 
> > > > Thanks :D
> > 
> > This is precisely what my "bootlink" on my web site, does Chris.
> > Basically the boot module you choose gets the address of the os9boot
> > file from its hard drives LSN0.
> > 
> > So it doesn't have to even live on the same hdbdos disk as the
> > boottrack since that address in LSN0 can be anyplace on the drive,
> > including plumb out of the os9 formatted portion of the drive. 
> > HDBDOS makes it piece of cake easy to have with its offset + vdisk
> > allocation scheme.
> > 
> > The syntax is "bootlink $82" or "bootlink 130" which is the decimal
> > version of $82. Bootlink translates according to whether or not the
> > first of the 3 chars is a dollar sign.  It goes and gets the
> > effective LSN0 of that hdbdos vdisk, seeks to the file and verifies
> > that it is indeed a legit os9boot file, and if it is, does the math
> > to dd.bt and dd.siz in the real lsn0, writes it into those 5 bytes,
> > so the next time it boots or reboots, it will boot using the newly
> > created os9boot file.
> > 
> > I have not done it yet, but what you want to do can (maybe) also be
> > done with the B&B utils "ba" and "bd" to clear those track 34 bits
> > in that disks FAT.  Hardly worth it since that only gains you 6144
> > bytes per vdisk. bd=Bit Deallocate.  However, I do not know if these
> > utils are multiple sector cluster aware.  From what someone else
> > said just this past week, the hint seems to indicate they are not.
> > 
> > Anyway, take a gander at it as I believe it can do this job.  Get it
> > from my web page at the Genes-os9-stf link.
> > 
> > > > أ¢â‚¬â€¹
> > > > أ¢â‚¬â€¹
> > > > +----------+
> > > > 
> > > > |David Ladd|
> > > > 
> > > > +----------+
> > > 
> > > os9gen -q=pathtobootfile
> > > 
> > > 
> > > 
> > > Christopher R. Hawks
> > > HAWKSoft
> > 
> > Cheers, Gene Heskett
> > --
> > 
> > "There are four boxes to be used in defense of liberty:
> >  soap, ballot, jury, and ammo. Please use in that order."
> > 
> > -Ed Howdershelt (Author)
> > Genes Web page <http://geneslinuxbox.net:6309/gene>
> > US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS
> > 
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS


More information about the Coco mailing list