Salora Manager Disk ROM

Discuss computers from the Laser series, Time & Fun handhelds, etc.
@username@
Posts: 172
Joined: Tue Oct 22, 2013 6:59 pm
Location: Glasgow, Scotland

Re: Salora Manager Disk ROM

Post by @username@ » Mon Apr 18, 2016 5:35 pm

Disc ROM Memory Mapped I/O

Code: Select all

$1128 - Read at initialisation and the result is thrown away. I assume this is a general reset controller
$1140 - Write Protect check. Returns $00 for not, $80 if write protection enable
$1180/$1181 - Step motor Phase 0 on/off respectively
$1182/$1183 - Step motor Phase 1 on/off respectively
$1184/$1185 - Step motor Phase 2 on/off respectively
$1186/$1187 - Step motor Phase 3 on/off respectively
$1188 - Motor off, drive deselect
$1189 - Drive enable
$118A - Motor on
$118C - In write mode, shifts data byte out. In read mode, shifts data byte in
$118D - In write mode - latch data byte
$118E - Set read mode, disable write mode
$118F - Write $FF to enable write mode
Drive enable / motor on may be the wrong way round - but as I don't have the actual hardware - it's a working guess.
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı

The creatiVision Emulator 16.04.24
Salora Manager / Laser 2001 BLOAD utility 0.9
CSL Cartridge middleware
http://sourceforge.net/projects/creativisionemulator
User avatar
Mobsie
Posts: 474
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: Salora Manager Disk ROM

Post by Mobsie » Tue Apr 19, 2016 9:49 am

Great Informations!
@username@
Posts: 172
Joined: Tue Oct 22, 2013 6:59 pm
Location: Glasgow, Scotland

Re: Salora Manager Disk ROM

Post by @username@ » Wed Apr 20, 2016 6:38 pm

Laser DOS V1.0
--------------

The Volume Table of Contents, VTOC, is always located at physical address track 17, sector 0. Tracks are formatted sequentially in ascending order.

This example is based on a disc containing a single Hello World style BASIC program.

Here is the sample VTOC

Code: Select all

0000EE00   00 11 0D 03  00 00 FE 00  00 00 00 00  00 00 00 00
0000EE10   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
0000EE20   00 00 00 00  00 00 00 7A  00 00 00 00  00 00 00 00
0000EE30   12 01 00 00  28 0E 00 01  00 00 00 00  FF FC 00 00
0000EE40   FF FC 00 00  FF FC 00 00  FF FC 00 00  FF FC 00 00
0000EE50   FF FC 00 00  FF FC 00 00  FF FC 00 00  FF FC 00 00
0000EE60   FF FC 00 00  FF FC 00 00  FF FC 00 00  FF FC 00 00
0000EE70   FF FC 00 00  FF FC 00 00  FF FC 00 00  00 00 00 00
0000EE80   3F FC 00 00  FF FC 00 00  FF FC 00 00  FF FC 00 00
0000EE90   FF FC 00 00  FF FC 00 00  FF FC 00 00  FF FC 00 00
0000EEA0   FF FC 00 00  FF FC 00 00  FF FC 00 00  FF FC 00 00
0000EEB0   FF FC 00 00  FF FC 00 00  FF FC 00 00  FF FC 00 00
0000EEC0   FF FC 00 00  FF FC 00 00  FF FC 00 00  FF FC 00 00
0000EED0   FF FC 00 00  FF FC 00 00  00 00 00 00  00 00 00 00
0000EEE0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
0000EEF0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
This is completely "borrowed" from AppleDOS 3.3! The only difference is that AppleDOS 3.3 has 16 sectors, and LaserDOS has 14.

So much so, that track 0 is marked as in use - which is where AppleDOS resides!

Code: Select all

Offset  Detail
-------------------
$00     Unused
$01     Track number of first directory entry [$11==17]
$02     Translated sector of first directory entry [$0D==13]
$03	DOS INIT version (hint $03 == AppleDOS 3.3 ;))
$04-$05 Unused
$06     Disc Volume number - always $FE==254, as formatted
$07-$26 Unused
$27     Number of track+sector pairs. ($7A==122 for 256 byte sectors)
$28-$2F Unused
$30     Last track sectors allocated ($12==18)
$31     Allocation direction (+1 or -1)
$32-$33 Unused
$34     Number of tracks per disc ($28==40)
$35     Number of sectors per track ($0E==14)
$36-$37 Little endian bytes per sectors ($100==256)
$38-$3B Sector allocation map for track 0
$3C-$3F Sector allocation map for track 1
...
$D4-$D7 Sector allocation map for track 39
$D8-$FF Unused
A few interesting things here. Laser DOS internally uses a lookup table to translate from physical sector address to Laser DOS sector address.

This is just an attempt to speed up disc access by skewing sectors to hopefully fall in line next.

The bitmap for sectors uses bit on to indicate available, bit off to indicate allocated. Sectors are allocated in a big endian format, starting from 0.

Code: Select all

Physical Sector 00 01 02 03 04 05 06 07 08 0A 0B 0C
Bitmap          80 40 20 10 08 04 02 01 80 40 20 10
The Laser DOS sector tranlsation is

Code: Select all

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D
00 0D 0B 09 07 05 03 01 02 0C 0A 08 06 04
Now the pointer to the first directory entry is calculated as Track 17 - Translated Sector 0D, which is physical sector 4.

The directory entry for this demo disc is

Code: Select all

0000F200   00 11 0C 00  00 00 00 00  00 00 00 12  0D 02 48 45  ..............HE
0000F210   4C 4C 4F 5E  5E 5E 5E 5E  5E 5E 5E 5E  5E 5E 5E 5E  LLO^^^^^^^^^^^^^
0000F220   5E 5E 5E 5E  5E 5E 5E 5E  5E 5E 5E 5E  02 00 00 00  ^^^^^^^^^^^^....
0000F230   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F240   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F250   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F260   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F270   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F280   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F290   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F2A0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F2B0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F2C0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F2D0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F2E0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0000F2F0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
The details for this directory entry is

Code: Select all

Offset  Details
---------------
$00     Unused
$01		Track number of next directory sector ($11==17)
$02     Translated sector number of next entry
$03-$0A Unused
$0B-$2D First file entry
...
$DD-$FF Seventh file entry
The file entry is detailed as

Code: Select all

Offset	Details
---------------
$00		Track of first track+sector list ($12==18)
        If this contains $FF this is a deleted entry
        If this contains $00 this is an unused entry (which is why
        track 0 is never used for data!)
$01		Translated sector of first track+sector list ($0C==12)
$02		File types
            $00 TEXT file        
            $02 BASIC program file
            $04 BINARY image file
           +$80 Protected file
$03-$20	Filename padded with character $5E. This is Laser DOS only,
        as it's the screen "space" fill character in BASIC
$21-$22 Length of file in sectors, little endian.
Still no sign of the program yet ... there's still further to go!

Using the Track+Sector list, you will get Track 18, physical sector 6. As the length is sectors is only 2 - it is assumed no track+sector list is needed - so it points to the actual short program

Code: Select all

00010200   39 00 24 50  0A 00 B2 20  54 48 49 53  20 49 53 20  9.$P... THIS IS
00010210   41 20 54 45  53 54 20 42  41 53 49 43  20 50 52 4F  A TEST BASIC PRO
00010220   47 52 41 4D  00 38 50 14  00 BA 22 48  65 6C 6C 6F  GRAM.8P..."Hello
00010230   20 57 6F 72  6C 64 21 22  00 00 00 FF  00 00 00 00   World!"........
00010240   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
00010250   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
00010260   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
00010270   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
00010280   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
00010290   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000102A0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000102B0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000102C0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000102D0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000102E0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000102F0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
This is a normal BASIC program. The first word is the length of the program, here $0039. BASIC programs are loaded to $5001 - so the rest of the data s just copied there.

Next time - a look at a larger file with a track+sector list.
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı

The creatiVision Emulator 16.04.24
Salora Manager / Laser 2001 BLOAD utility 0.9
CSL Cartridge middleware
http://sourceforge.net/projects/creativisionemulator
User avatar
MADrigal
Site Admin
Posts: 970
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: Salora Manager Disk ROM

Post by MADrigal » Thu Apr 21, 2016 7:44 am

This is so exciting, you must be very proud of what you have achieved. Well done, mate!
User avatar
Mobsie
Posts: 474
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: Salora Manager Disk ROM

Post by Mobsie » Thu Apr 21, 2016 8:31 am

i cannot say more then Luca!
You got my full respect!
User avatar
Scouter3d
Posts: 266
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: Salora Manager Disk ROM

Post by Scouter3d » Thu Apr 21, 2016 1:41 pm

I am awestruck again! :0)
@username@
Posts: 172
Joined: Tue Oct 22, 2013 6:59 pm
Location: Glasgow, Scotland

Re: Salora Manager Disk ROM

Post by @username@ » Thu Apr 21, 2016 6:30 pm

This is the track+sector list of a large file, in this case BIOS, MSAVE BIOS,A$C000,L$4000

Code: Select all

00010000   00 00 00 00  00 00 00 00  00 00 00 00  12 0C 12 0B  ................
00010010   12 0A 12 09  12 08 12 07  12 06 12 05  12 04 12 03  ................
00010020   12 02 12 01  12 00 13 0D  13 0C 13 0B  13 0A 13 09  ................
00010030   13 08 13 07  13 06 13 05  13 04 13 03  13 02 13 01  ................
00010040   13 00 14 0D  14 0C 14 0B  14 0A 14 09  14 08 14 07  ................
00010050   14 06 14 05  14 04 14 03  14 02 14 01  14 00 15 0D  ................
00010060   15 0C 15 0B  15 0A 15 09  15 08 15 07  15 06 15 05  ................
00010070   15 04 15 03  15 02 15 01  15 00 16 0D  16 0C 16 0B  ................
00010080   16 0A 16 09  16 08 16 07  16 06 16 05  16 04 00 00  ................
00010090   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000100A0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000100B0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000100C0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000100D0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000100E0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
000100F0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
In detail this is

Code: Select all

Offset  Detail
--------------
$00     Unused
$01     Track Number of next track+sector list
$02     Translated sector number of next track+sector list
$03-$04 Unused
$05-$06 Sector offset in file of the first sector on this list
$07-$08 Unused
$0C     First data track of file
$0D     First translated data sector
...
$FE     119th data track of this file
$FF     119th translated data sector
As this was a binary file, it seems like a good idea to look at the file header too!

Code: Select all

00010200   00 C0 00 40  20 54 FE A9  FF 8D 00 03  A9 00 85 D8  ...@ T..........
00010210   A2 00 BD D6  FB 9D 00 B0  BD 00 B0 DD  D6 FB D0 06  ................
00010220   E8 D0 EF 4C  60 C0 A9 00  8D 54 03 8D  55 03 AA A8  ...L`....T..U...
00010230   18 BD 00 BF  79 54 03 99  54 03 E8 D0  F3 C8 C0 02  ....yT..T.......
00010240   D0 EE AD 54  03 CD 55 03  D0 1A A0 00  E8 E0 FF F0  ...T..U.........
00010250   0C AD 00 BF  DD 00 BF F0  F3 C8 4C 48  C0 C0 03 90  ..........LH....
Binary MSAVE files are stored as word memory load address, here $C000. Word 2 is the length of the data, here $4000.
Thereafter, it's just the binary file.
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı

The creatiVision Emulator 16.04.24
Salora Manager / Laser 2001 BLOAD utility 0.9
CSL Cartridge middleware
http://sourceforge.net/projects/creativisionemulator
User avatar
MADrigal
Site Admin
Posts: 970
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: Salora Manager Disk ROM

Post by MADrigal » Fri Apr 22, 2016 8:17 am

It seems to me that there is a 256-gap between the header and the data?

The header as you quoted is $10000-$100ff and the data is $10200-etc. Is this correct? What about that gap?
@username@
Posts: 172
Joined: Tue Oct 22, 2013 6:59 pm
Location: Glasgow, Scotland

Re: Salora Manager Disk ROM

Post by @username@ » Fri Apr 22, 2016 10:38 am

There is a gap due to sector skew. The track+sector list points to each sector in sequence.

I agree it's inefficient but that's what we have.
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı

The creatiVision Emulator 16.04.24
Salora Manager / Laser 2001 BLOAD utility 0.9
CSL Cartridge middleware
http://sourceforge.net/projects/creativisionemulator
User avatar
MADrigal
Site Admin
Posts: 970
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: Salora Manager Disk ROM

Post by MADrigal » Fri Apr 22, 2016 1:29 pm

AFAYK, Is that this "gap" also common to Apple DOS and/or to other DOS systems, example the C64?
Post Reply