Home Page · Up 1 Level · Site Map · Send Us Mail
Creating OS9 Device Descriptors
CD-i 605 Player (or CD-i Emulator)
Only /h0, /h1, and /h2 (+formatting descriptors) are provided in ROM.
If you would like to make /h3, /h4, /h6, or /h7(the player is at ID#5) you can use the OS9 utility moded to hack one of the existing device descriptors. For example, "h4":
Follow these steps:
At an OS9 prompt:
Type chd /h0/cmds/bootobjs
Type save <device descriptor> (e.g. "save h2")
Type rename h2 <new descriptor name> (e.g. "rename h2 h4")
Type moded h2 -f=h4
Type ? (to get a list of options)
moded: ?
e(dit) - edit the current module
f(ile) - open a new file of modules
l(ist) - list contents of module
m(odule) - find a module in the current file
w(rite) - update module crc and write to file
q(uit) - leave the module editor
$ - call the os-9 shell
? - print this help message
For example, if you typed "l" to list descriptors h2 and h0 you would get this:
moded: l
descriptor name : h2
file manager name : RBF
device driver name : rbscsi
port address : $00000000
irq vector : 0
irq level : 0
irq priority : 0
device mode capabilities : $a7
device class : $01
drive number : 2
(etc)
control word : $000b
(etc)
scsi controller id : $02
(etc)
moded: f
filename to use: h0
moded: l
name of module to use (return if same as file name) :
descriptor name : h0
file manager name : RBF
device driver name : rbscsi
port address : $00000000
irq vector : 0
irq level : 0
irq priority : 0
device mode capabilities : $a7
device class : $01
drive number : 0
(etc)
control word : $000f
(etc)
scsi unit number of drive : 0
(etc)
scsi controller id : $00
(etc)
As you can see, the only differences between these two modules are:
descriptor name.
drive number
control word and
scsi controller id
You will need to change a, b, and d. c is optional depending on whether you want to change certain i/o parameters. For h4, change them like this:
At the moded: prompt, type "e"
change the device descriptor name to h4
change the drive number to 4
optionally, change the control_word (below).
change the SCSI controller id to $04.
Then, at the moded: prompt, type "w" to write the changes, and q to quit.
You'll need to load the device driver, e.g. load /h0/cmds/bootobjs/h4, before you can use it. You could put this in mm_cust if you like, so that the drivers are loaded at startup.
Control Word modification
When you get to the control word: prompt, you can type "??" to see all available options. You'll get a printout like this:
control word : $000b = ??
---------------------------
PD_Cntl: This is the descriptor control word.
bit 0 -- 0 = media is format enabled.
1 = media is format protected.
Normally, hard disks are format "protected" to prevent accidental
erasure. When this is done, a "format enabled" version of the
descriptor is used to allow hard disk formatting. When using
non-volatile ramdisks, this flag is set to prevent re-formatting
of the ramdisk.
bit 1 -- 0 = driver/controller can perform single-sector i/o.
1 = driver/controller can perform multi-sector i/o.
If the controller and device driver can support multi-sector i/o
transfers, much faster disk operations can be achieved.
bit 2 -- 0 = device does not have stable id.
1 = device has stable id.
This flag indicates that the media cannot be changed, or that the
driver can keep the media id updated when the media is changed.
bit 3 -- 0 = device size determined from device descriptor.
1 = device size determined by asking the drive itself.
Media that supports "read capacity" to determine the media size
should set this bit.
bit 4 -- 0 = device cannot format a single track
1 = device can format a single track
This flag signals whether the media can be formatted on a track
by track basis (e.g. disk repair utilities).
---------------------------
Explanation:
The $000b is the hex version of the above. This is the typical control word for a hard drive device descriptor. Only the "b" part is important. The rest of numbers should always be "0", essentially. "b" translates to the binary number 1011. This means:
bit3 | bit2 | bit1 | bit0
|
1 | 0 | 1 | 1
|
(For h0, the control word is $000f. This sets bit2 to 1, indicating stable id. Usually save and rename h1 or h2, so that you won't have to change the control word.)
On the other hand, the control word for a FORMAT device descriptor (e.g. h1fmt) is typically $000a. This translates to binary 1010.
bit3 | bit2 | bit1 | bit0
|
1 | 0 | 1 | 0
|
CD-i Emulator (back to CD-i 605 Player)
The steps for creating additional drivers for the emulator are similar to those for the player, but not exactly the same. To wit:
- You must save and use an emulator device driver to modify, not a 605 player equivalent.
- You should change the port address of the drive, rather than the drive number. You do this by
changing the last digit only. For example, if you save the h0 device descriptor, it would have the port address of $01f00000. In order to make the port address for h4, change it to $01f00004.
Home Page · Up 1 Level · Site Map · Send Us Mail