Taking Dos off a Dos 3.3 disk, and using the built in "Screen Display code?" [message #347782] |
Sat, 08 July 2017 08:10 |
|
Originally posted 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.
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
|
|
|
Re: Taking Dos off a Dos 3.3 disk, and using the built in "Screen Display code?" [message #347786 is a reply to message #347782] |
Sat, 08 July 2017 09:04 |
Michael AppleWin Debu
Messages: 1262 Registered: March 2013
Karma: 0
|
Senior Member |
|
|
On Saturday, July 8, 2017 at 5:10:32 AM UTC-7, Tom Porter wrote:
> 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 ?
> 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.
> 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/Michaelang el007/apple2_dos33/blob/master/dos33.html#ColorHexDump
Michael
|
|
|
Re: Taking Dos off a Dos 3.3 disk, and using the built in "Screen Display code?" [message #347790 is a reply to message #347786] |
Sat, 08 July 2017 11:24 |
qkumba
Messages: 1584 Registered: March 2013
Karma: 0
|
Senior Member |
|
|
> 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.
|
|
|
Re: Taking Dos off a Dos 3.3 disk, and using the built in "Screen Display code?" [message #347791 is a reply to message #347782] |
Sat, 08 July 2017 11:31 |
Michael AppleWin Debu
Messages: 1262 Registered: March 2013
Karma: 0
|
Senior Member |
|
|
On Saturday, July 8, 2017 at 5:10:32 AM UTC-7, Tom Porter wrote:
> 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
|
|
|
|
|
|
|