• Please review our updated Terms and Rules here

OS/8 Driver Questions and an OS/8 Peculiarity

BitWiz

Experienced Member
Joined
Sep 7, 2021
Messages
420
Location
Glen Ellyn, Iil
I am writing down these questions as I read Doug Ingram's OS/8 device driver reference tome (deep respect intended).

Doug - Thank you for this very informative and useful document. I plan on preserving it for future reference.

If the data field is set to the current data field before the call to the handler, the data field passed in Function Control word allows for the data to be read from or written to a different field than that of the data field of the calling program?
I think this is answered with the following statement: "The next argument (BUFFER) is the 12 bit pointer to the transfer buffer. This combined with bits 6-8 in the FCB gives a 15 bit address specifying anywhere in memory."

On page 9 it says: "The word after the starting block is where the handler will return if there is an error. In the case of an error the AC will be positive if the end of file was encountered and negative if there was a fatal error."
By end of file do you mean end of device? Since this command is low level block oriented and not file oriented I/O.

Also on page 9 it says: "On a normal return from a device handler the AC is zero and the Data Field is restored to its calling value which is the same as the instruction field."
When calling OS/8 device drivers, is it required that the data field and instruction fields be the same?

How does OS/8 know whether there is a system header on the drive and therefore where the directory is?

Do all OS/8 block devices have the same size directory (number of entries).

Is the directory structure documented in the OS/8 handbook?

If I run BUILD and create a bootable RX02 disk with a zero directory. And then copy CCL.SV and then DIRECT.SV (and then some other utilities) when I boot off of the floppy trying to do a DIR hangs the computer. However, if I copy DIRECT.SV and then CCL.SV everything seems to work fine.
Do you guys have any idea why this is happening? My thought was to put CCL as close to the beginning of the disk to reduce seeking and command load times.

Here is the exact process I used to create the failure:

.RU SYS BUILD

$PR

BAT : *BAT
KL8E: *TTY
LPSV: *LPT
RK8E: *SYS RKA0 RKB0
RK05: *RKA0 *RKB0 *RKA1 *RKB1 RKA2 RKB2 RKA3 RKB3
RX02: *RXA0 *RXA1
TD8A: *DTA0 *DTA1
RL0 : *RL0A *RL0B

DSK=RK8E:SYS
$UN KL8E
$UN RK8E
$UN RK05
$UN TD8A
$UN RL0
$PR

BAT : *BAT
LPSV: *LPT
RX02: *RXA0 *RXA1

DSK=RK8E:SYS

$LO SDSKNS
$LO RX02SY
$LO KL8E.DV

$IN KL8E:TTY
$IN RX02:SYS,RXA0-1
$IN SDNS:SDA0-3,SDB0-3
$DSK=RX02:SYS
$PR

BAT : *BAT
LPSV: *LPT
RX02: *RXA0 *RXA1
SDNS: *SDA0 *SDB0 *SDA1 *SDB1 *SDA2 *SDB2 *SDA3 *SDB3
RX02: *SYS
KL8E: *TTY

DSK=RX02:SYS
$BOOT
WRITE ZERO DIRECT?Y
SYS BUILT
(boot from floppy)
.DIR
NO CCL!

(boot from serial disk)

.R FOTP
*RXA0:<CCL.SV
*RXA0:<DIRECT.SV
*RXA0:<FOTP.SV
*RXA0:<DIRECT.SV
*RXA0:<PIP.SV
*^C

.DIR RXA0:(BEHIR)

CCL .SV 0070 31 FOTP .SV 0136 8 <Empty> 0161 875
DIRECT.SV 0127 7 PIP .SV 0146 11

4 Files in 57 Blocks - 875 Free blocks

(boot from RX02)
.
.DIR (the system hangs here)

I changed the copy order to be as follows and everything works:

DIRECT.SV 0070 7 FOTP .SV 0136 8 <Empty> 0161 875
CCL .SV 0077 31 PIP .SV 0146 11
 
How does OS/8 know whether there is a system header on the drive and therefore where the directory is?

Do all OS/8 block devices have the same size directory (number of entries).

Is the directory structure documented in the OS/8 handbook?
The directory is always in blocks 1-6, I believe.

The directory header indicates the beginnig data block, which differs between 07 and 070 depending on if it is a system volume. The directory format is documented in the OS/8 SRM.
 
As for the "far call" to the driver, the drivers follow the standard PDP-8 convention that the DF is changed to match IF before the call, since the call itself will over-write IF. IF would need to be saved somewhere, and DF is often already a copy of IF, saving code.
 
The directory header indicates the beginnig data block, which differs between 07 and 070 depending on if it is a system volume. The directory format is documented in the OS/8 SRM.
So does OS/8 check both block 7 and block 70 for the directory.
 
If the data field is set to the current data field before the call to the handler, the data field passed in Function Control word allows for the data to be read from or written to a different field than that of the data field of the calling program?
You set the data field equal to the instruction field so the handler knows what field to return to. Often they are already the same so you don't need to do anything. The 3 bits in the FCW are the field of the data transfer.

On page 9 it says: "The word after the starting block is where the handler will return if there is an error. In the case of an error the AC will be positive if the end of file was encountered and negative if there was a fatal error."
By end of file do you mean end of device? Since this command is low level block oriented and not file oriented I/O.
The words that DEC wrote are for both block and character device handlers. I have not checked all handlers but I suspect that it is not 100% consistent so it is difficult to answer the question. Is reading off the end of the device a fatal error? I believe I treated it that way in CSD. Not as end of file. End of file is more properly what you should get if the end of a paper tape is reached or a file mark is read on a mag tape. The TTY handler treats control Z as end of file.

Also on page 9 it says: "On a normal return from a device handler the AC is zero and the Data Field is restored to its calling value which is the same as the instruction field."
When calling OS/8 device drivers, is it required that the data field and instruction fields be the same?
They do not have to be the same. But if they are not you will most likely not regain control when the handler exits unless you know what you are doing. At this point I recommend against trying to be clever and having the handler return to a different field than the one from which it was called. You need a solid understanding of inter field subroutine calls before you try this. It can be confusing.
How does OS/8 know whether there is a system header on the drive and therefore where the directory is?

From memory I think the first word of block 1 is the pointer to the first data block. It will be either 0007 or 0070 if a system image. I think that is right. This is not a handler related question.

Do all OS/8 block devices have the same size directory (number of entries).
Yes. Directories are always found in blocks 1-6.

Is the directory structure documented in the OS/8 handbook?
I think it is in a different manual.

If I run BUILD and create a bootable RX02 disk with a zero directory. And then copy CCL.SV and then DIRECT.SV (and then some other utilities) when I boot off of the floppy trying to do a DIR hangs the computer. However, if I copy DIRECT.SV and then CCL.SV everything seems to work fine.
Do you guys have any idea why this is happening? My thought was to put CCL as close to the beginning of the disk to reduce seeking and command load times.
Sorry, I don't know why that doesn't work.
 
Doug,

Thank you for your document and detailed answers. All this about a 50 year old Operating System. Thank you for keeping the flame burning.
 
In my quest to consolidate PDP-8 software and convert what I have to RK05 images for Serial Disk I have a question that has probably been asked before.

How can I convert .PB Binary loader filed to an OS/8 SAVE format file? Preferably without having to load them as paper tape and figure out where they are in memory?

Also, from an OS/8 loading perspective, what is the difference between .BN ABSLDR files and .SV SAVE files. R and RI will run a .SV file but if I LOAD a .BN file how do I know where it starts?

Thanks,

Mike
 
In my quest to consolidate PDP-8 software and convert what I have to RK05 images for Serial Disk I have a question that has probably been asked before.

How can I convert .PB Binary loader filed to an OS/8 SAVE format file? Preferably without having to load them as paper tape and figure out where they are in memory?
There is a bn2sv tool in the 8tools suite. Alternatively, you can LOAD the .BN and then SAVE.

The BN format does not specify an address to begin execution. I believe you'll need to provide a starting address during the SAVE command. IIRC that's done with the "=" syntax.

Also, from an OS/8 loading perspective, what is the difference between .BN ABSLDR files and .SV SAVE files. R and RI will run a .SV file but if I LOAD a .BN file how do I know where it starts?
They are just two different things. One is a stream of bytes that looks rather like a BIN format paper tape. The other is a save image of blocks of words as they are loaded into memory. The SAVE format also has a bunch of flags that can help OS/8 optimize the loading.

This is reflected in the commands to use them. LOAD works with BN files, RUN works with SAVE files.

Vince
 
Back
Top