Discussion:
Taking Dos off a Dos 3.3 disk, and using the built in "Screen Display code?"
(too old to reply)
Tom Porter
2017-07-08 12:10:30 UTC
Permalink
Raw Message
If someone takes DOS off a 3.3 disk, it is replaced with a small snippet of code that can display a message, and if you sector edit it, can practically say anything you want.

Is there a simple method to replace the display code, and put something there, possibly 256 or 512 bytes of machine code you can run directly in this mode?

Also, was thinking about destroying/removing one of the catalog sectors, cleverly hiding disk identity that almost nobody would think of checking, because on a SECTORSCAN/MAP would appear the entire catalog TRACK 17 would be used...

Tom- Naspite
Michael 'AppleWin Debugger Dev'
2017-07-08 13:04:06 UTC
Permalink
Raw Message
Post by Tom Porter
If someone takes DOS off a 3.3 disk, it is replaced with a small snippet of code that can display a message, and if you sector edit it, can practically say anything you want.
Tom,

_Which_ program are you using to do this?
_What_ is the boot sector, T0S0, that it is replaced with ?
Post by Tom Porter
Is there a simple method to replace the display code, and put something there, possibly 256 or 512 bytes of machine code you can run directly in this mode?
Custom boot sectors are trivial to write for a "data disk" (aka a disk without any DOS/ProDOS/etc.)

- - - 8< hello_boot - - -

DRIVE_SLOT_X16 EQU $2B ; Drive Slot * 16
DRIVE_MOTOR_OFF EQU $C088
COUT EQU $FDED
APPLESOFT EQU $E000

ORG $800

; ------ Main ----- ; T0S0 $0800
DB $01 ; Tell C600 PROM to read 1 Sectors

STA DRIVE_MOTOR_OFF,X ; X=$60, drive slot*16

LDX #0
GetText
LDA Text,X
BEQ EndText
JSR COUT
INX
BNE GetText
EndText
JMP APPLESOFT

Text
ASC "Hello World Boot Sector"
DB 0

DS \,0 ; Pad until end-of-sector 0

- - - END - - -

Which assembles to:

0800:01 9D 88 C0 A2 00 BD 14
0808:08 F0 06 20 ED FD E8 D0
0810:F5 4C 00 E0 C8 E5 EC EC
0818:EF A0 D7 EF F2 EC E4 A0
0820:C2 EF EF F4 A0 D3 E5 E3
0828:F4 EF F2 00 00 00 00 00
0830:00 00 00 00 00 00 00 00
0838:00 00 00 00 00 00 00 00
0840:00 00 00 00 00 00 00 00
0848:00 00 00 00 00 00 00 00
0850:00 00 00 00 00 00 00 00
0858:00 00 00 00 00 00 00 00
0860:00 00 00 00 00 00 00 00
0868:00 00 00 00 00 00 00 00
0870:00 00 00 00 00 00 00 00
0878:00 00 00 00 00 00 00 00
0880:00 00 00 00 00 00 00 00
0888:00 00 00 00 00 00 00 00
0890:00 00 00 00 00 00 00 00
0898:00 00 00 00 00 00 00 00
08A0:00 00 00 00 00 00 00 00
08A8:00 00 00 00 00 00 00 00
08B0:00 00 00 00 00 00 00 00
08B8:00 00 00 00 00 00 00 00
08C0:00 00 00 00 00 00 00 00
08C8:00 00 00 00 00 00 00 00
08D0:00 00 00 00 00 00 00 00
08D8:00 00 00 00 00 00 00 00
08E0:00 00 00 00 00 00 00 00
08E8:00 00 00 00 00 00 00 00
08F0:00 00 00 00 00 00 00 00
08F8:00 00 00 00 00 00 00 00

Easy to use Copy ][ Plus Sector Editor to read/write this to T0S0.
Post by Tom Porter
Also, was thinking about destroying/removing one of the catalog sectors, cleverly hiding disk identity that almost nobody would think of checking, because on a SECTORSCAN/MAP would appear the entire catalog TRACK 17 would be used...
The DOS 3.3. CATALOG is a linked listed so this is pretty trivial to do.

Sector Edit, Read Track $11, Sector $2.
Address: 01
From: 11 01
To: 00 00

Now you can hide your message on Track $11, Sector $1. It won't get over-written since when the disk was INIT'd the entire track $11 was marked "in use" by the VTOC. :-)

Other places to stash data is on Track 2 since DOS stupidly reserves the ENTIRE track even though only sectors $00 .. $04 sectors are used! NOTE: Pronto-DOS only uses Sector 0, so you have up to 15 sectors worth of data.

If you are curious how DOS 3.3 uses Tracks 0, 1, and 2 then you'll probably want to review my DOS 3.3 Color-Coded Hex Dump.

https://htmlpreview.github.io/?https://github.com/Michaelangel007/apple2_dos33/blob/master/dos33.html#ColorHexDump

Michael
qkumba
2017-07-08 15:24:00 UTC
Permalink
Raw Message
Post by Michael 'AppleWin Debugger Dev'
Other places to stash data is on Track 2 since DOS stupidly reserves the ENTIRE track even though only sectors $00 .. $04 sectors are used! NOTE: Pronto-DOS only uses Sector 0, so you have up to 15 sectors worth of data.
And Directi-DOS uses no sectors at all in track 2.
Various boot sector sources are on my Github site.
Other than the fact that the boot sector always loads to $800, there are no restrictions on what you can do, including moving the code to another location after it starts running.
Michael 'AppleWin Debugger Dev'
2017-07-08 15:39:12 UTC
Permalink
Raw Message
Post by qkumba
And Directi-DOS uses no sectors at all in track 2.
TIL -- Good to know!
Post by qkumba
Various boot sector sources are on my Github site.
I presume ...

https://github.com/peterferrie/0boot
https://github.com/peterferrie/Directi-DOS
https://github.com/peterferrie/standard-delivery
https://github.com/peterferrie/qboot

Did I miss any? :-)
(other then ProRWTS of course)
qkumba
2017-07-09 17:03:50 UTC
Permalink
Raw Message
Post by Michael 'AppleWin Debugger Dev'
Post by qkumba
Various boot sector sources are on my Github site.
I presume ...
https://github.com/peterferrie/0boot
https://github.com/peterferrie/Directi-DOS
https://github.com/peterferrie/standard-delivery
https://github.com/peterferrie/qboot
Did I miss any? :-)
(other then ProRWTS of course)
I think that's it. I will upload ProBoot at some point - 343 bytes loader of named (so not necessarily the first) .SYSTEM file from a ProDOS-format floppy. It allows block 1 to be used for storage.
Michael 'AppleWin Debugger Dev'
2017-07-09 18:10:16 UTC
Permalink
Raw Message
Post by qkumba
I will upload ProBoot at some point - 343 bytes loader of named (so not necessarily the first) .SYSTEM file from a ProDOS-format floppy. It allows block 1 to be used for storage.
/sarcasm You mean no one uses an Apple /// and the Block 1? I'm shocked, shocked I tell you!
Tom Porter
2017-07-10 02:00:52 UTC
Permalink
Raw Message
I forgot to check back on this one....

There is a nibble program I found that can do various things to your disk... take dos off it (I find its not complete for pronto)... remove sectors from the VOC file table to make extra space, if you do not need to store 106 files ect..) https://www.dropbox.com/s/9bew2wusaa9wpr4/Stretcher.dsk?dl=0

Also included is another file I found recently, disk encryptor... very interesting

(With the above, if you have Pronto, take dos off, the extra 11 sectors, use copy plus to remove the additional dos junk and make only 10 sectors available for file table aka 70 files... you have 533 free sectors on your 'data or side B disk... not too bad!
Michael 'AppleWin Debugger Dev'
2017-07-08 15:31:34 UTC
Permalink
Raw Message
Post by Tom Porter
If someone takes DOS off a 3.3 disk, it is replaced with a small snippet of code that can display a message, and if you sector edit it, can practically say anything you want.
I also should point out that due to DOS's dumb File System design you can't save/load ANY files on Track 0. One would have to change the BEQ to BMI in GETSEC, BEQ to BMI in FRESEC,and elsewhere.

i.e.
GETSEC
B244:AD 51 B5 LDA DCBATK ; GET ALLOCATED TRK
B247:F0 21 BEQ GSS1 ; BR IF NONE
Loading...