Cleanup leftover atari code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38954 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
675ffabd70
commit
0128537395
@ -251,168 +251,6 @@ putxdisp:
|
||||
#if 0
|
||||
|
||||
|
||||
load_failed:
|
||||
//bra _exit
|
||||
|
||||
spin:
|
||||
//bra spin
|
||||
_exit: /* */
|
||||
lea failure_string,%a0
|
||||
bsr puts
|
||||
bsr getc
|
||||
|
||||
movem.l (%sp)+,%d1-%d7/%a0-%a6
|
||||
rts
|
||||
//rts
|
||||
|
||||
/** Loads %d2 sectors from floppy disk, starting at head XXX %dh, sector %cx.
|
||||
* The data is loaded to %a2.
|
||||
*/
|
||||
|
||||
load_sectors:
|
||||
|
||||
#if 0
|
||||
/* it seems to skip 9 every 9 sectors, buggy side handling ? */
|
||||
// Rwabs
|
||||
//move.l #1,-(%sp)
|
||||
move.w #0,-(%sp) // A:
|
||||
//move.w #2,-(%sp) // C:
|
||||
//move.w #-1,-(%sp) // 2nd sector
|
||||
move.w #1,-(%sp) // 2nd sector
|
||||
move.w %d2,-(%sp)
|
||||
move.l %a2,-(%sp)
|
||||
//move.w #RW_READ+RW_NOTRANSLATE,-(%sp)
|
||||
move.w #RW_READ+RW_NOMEDIACH,-(%sp)
|
||||
move.w #4,-(%sp)
|
||||
trap #13
|
||||
add.l #14,%sp
|
||||
#endif
|
||||
#if 0
|
||||
// d2:
|
||||
|
||||
//move.w %d2,-(%sp)
|
||||
move.w #1,-(%sp) // count
|
||||
move.w #0,-(%sp) // sideno
|
||||
move.w #0,-(%sp) // trackno
|
||||
move.w #1,-(%sp) // sectno
|
||||
move.w TOSVAR_bootdev,-(%sp) // devno
|
||||
clr.l -(%sp) // filler
|
||||
//move.w #0,-(%sp)
|
||||
//move.l %a2,-(%sp)
|
||||
move.l #ATARI_ZBEOS_BASE,-(%sp)
|
||||
move.w #8,-(%sp) // floprd
|
||||
trap #XBIOS_TRAP
|
||||
add.l #20,%sp
|
||||
#endif
|
||||
|
||||
//bsr putx
|
||||
//rts
|
||||
|
||||
/*
|
||||
* %d3: remaining sects
|
||||
* %d4: sectno
|
||||
* %d5: trackno
|
||||
* %d6: sideno
|
||||
* %d7: sect / track
|
||||
* %a5: buffer
|
||||
*
|
||||
*/
|
||||
// load the rest
|
||||
|
||||
// XXX: the NetBSD loader probes it, but trying to asserts ARAnyM
|
||||
clr.l %d7
|
||||
move.b _fat_spt,%d7 // sect/track
|
||||
//move.w #0,%d7 // sect/track
|
||||
move.w #0,%d6 // sideno
|
||||
move.w #0,%d5 // trackno
|
||||
move.w #1,%d4 // sectno
|
||||
move.w sNumSectors,%d3 // remainder
|
||||
move.l #AMIGA_ZBEOS_BASE,%a5
|
||||
read_sectors_loop:
|
||||
bsr.s read_sect
|
||||
bne read_sectors_fail
|
||||
moveq #'.',%d0
|
||||
bsr putc
|
||||
subq.w #1,%d3 // remainder--
|
||||
bne.s read_sectors_next
|
||||
bsr putcrlf
|
||||
clr.l %d0
|
||||
rts
|
||||
|
||||
// compute next track/side/sector
|
||||
read_sectors_next:
|
||||
#if 0 //DEBUG
|
||||
// [TRAK][SIDE]
|
||||
move.w %d5,%d0
|
||||
swap %d0
|
||||
move.w %d6,%d0
|
||||
bsr putx
|
||||
// [SECT][S/TK]
|
||||
move.w %d4,%d0
|
||||
swap %d0
|
||||
move.w %d7,%d0
|
||||
bsr putx
|
||||
//bsr getc
|
||||
#endif //!DEBUG
|
||||
add.l #SECTSIZE,%a5
|
||||
addq.w #1,%d4 // sectno++
|
||||
cmp.w %d7,%d4 // if (sectno == spt)
|
||||
bne.s .rs2 // {
|
||||
addq.w #1,%d6 // sideno++ ;
|
||||
cmp.w #2,%d6 // if (sideno == 2) {
|
||||
bne .rs1
|
||||
clr.w %d6 // sideno = 0 ;
|
||||
addq.w #1,%d5 // trackno++ ;
|
||||
bsr putcrlf
|
||||
|
||||
.rs1: // }
|
||||
clr.w %d4 // sectno = 0 ;
|
||||
.rs2: // }
|
||||
|
||||
bra.s read_sectors_loop
|
||||
|
||||
read_sectors_fail:
|
||||
tst.w %d7 // s/t
|
||||
bne read_sectors_fail2
|
||||
move.w %d4,%d0
|
||||
bsr putx
|
||||
move.w %d4,%d7
|
||||
clr.w %d4
|
||||
//add.w #1,
|
||||
bra.s read_sectors_next
|
||||
read_sectors_fail2:
|
||||
moveq #1,%d0
|
||||
rts
|
||||
|
||||
|
||||
read_sect: /* read 1 sector */
|
||||
/*
|
||||
* %d4: sectno
|
||||
* %d5: trackno
|
||||
* %d6: sideno
|
||||
* %d7: remaining count
|
||||
* %a5: buffer
|
||||
*
|
||||
*/
|
||||
#if 1
|
||||
//move.w %d2,-(%sp)
|
||||
//move.w #1,-(%sp) // count
|
||||
//move.w #0,-(%sp) // sideno
|
||||
//move.w #0,-(%sp) // trackno
|
||||
//move.w #2,-(%sp) // sectno
|
||||
move.w #1,-(%sp)
|
||||
movem.w %d4-%d6,-(%sp)
|
||||
move.w TOSVAR_bootdev,-(%sp) // devno
|
||||
clr.l -(%sp) // filler
|
||||
move.l %a5,-(%sp)
|
||||
move.w #8,-(%sp) // floprd
|
||||
trap #XBIOS_TRAP
|
||||
add.l #20,%sp
|
||||
tst.l %d0
|
||||
|
||||
#endif
|
||||
rts
|
||||
|
||||
floppy_end:
|
||||
// .org FAILURE_STRING
|
||||
failure_string:
|
||||
@ -423,68 +261,11 @@ failure_string:
|
||||
// .org DOT_STRING
|
||||
// .string "."
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
puts:
|
||||
.loopt:
|
||||
move.b (%a0)+,%d0
|
||||
beq .strout
|
||||
bsr putc
|
||||
bra .loopt
|
||||
.strout:
|
||||
putcrlf:
|
||||
move.b #'\r',%d0
|
||||
bsr putc
|
||||
move.b #'\n',%d0
|
||||
bsr putc
|
||||
rts
|
||||
|
||||
|
||||
/* prints the char in d0.b to the console */
|
||||
putc:
|
||||
movem.l %d0-%d2/%a0-%a2,-(%sp)
|
||||
move.w %d0,-(%sp)
|
||||
move.w #DEV_CON,-(%sp) // DEV_CON
|
||||
move.w #3,-(%sp) // Bconout
|
||||
trap #BIOS_TRAP
|
||||
add.l #6,%sp
|
||||
movem.l (%sp)+,%d0-%d2/%a0-%a2
|
||||
rts
|
||||
|
||||
/* waits for a key */
|
||||
getc:
|
||||
movem.l %d1-%d2/%a0-%a2,-(%sp)
|
||||
move.w #DEV_CON,-(%sp) // DEV_CON
|
||||
move.w #2,-(%sp) // Bconin
|
||||
trap #BIOS_TRAP
|
||||
add.l #4,%sp
|
||||
movem.l (%sp)+,%d1-%d2/%a0-%a2
|
||||
rts
|
||||
|
||||
str:
|
||||
.string "Haiku!"
|
||||
label_prg:
|
||||
.string "P" //"RG boot"
|
||||
label_floppy:
|
||||
.string "F" //"loppy boot"
|
||||
h4:
|
||||
.string "H4"
|
||||
h5:
|
||||
.string "H5"
|
||||
msg_j1:
|
||||
.string "Jumping to haiku_loader."
|
||||
|
||||
shell_end:
|
||||
//.fill (0x01fe - shell_end), 1, 0x55
|
||||
.org 0x01fe
|
||||
.word 0xaa55-1 // will be replaced by the one calculated by the build.
|
||||
// we make sure PCs don't try to execute it.
|
||||
// this bumps the "start" label to offset 0x0200 as
|
||||
// expected by the BFS boot loader, and also marks
|
||||
// this block as valid boot block for the BIOS
|
||||
#endif
|
||||
|
||||
sNumSectors:
|
||||
@ -535,68 +316,6 @@ end_buff:
|
||||
|
||||
#if 0
|
||||
|
||||
prg_start:
|
||||
lea label_prg,%a0
|
||||
bsr puts
|
||||
|
||||
// .prg:
|
||||
// we need to switch to supervisor mode anyway
|
||||
move.l #SUP_SET,-(%sp)
|
||||
move.w #0x20,-(%sp)
|
||||
trap #1
|
||||
addq.l #6,%sp
|
||||
move.l %d0,saved_super_stack
|
||||
|
||||
#if 0
|
||||
//_membot
|
||||
move.l #0x432,%a0
|
||||
move.l (%a0),%d0
|
||||
bsr putx
|
||||
|
||||
//_memtop
|
||||
move.l #0x436,%a0
|
||||
move.l (%a0),%d0
|
||||
bsr putx
|
||||
|
||||
//_v_bas_ad
|
||||
move.l #0x44e,%a0
|
||||
move.l (%a0),%d0
|
||||
bsr putx
|
||||
#endif
|
||||
// disable interrupts
|
||||
//or.w #0x0700,%sr
|
||||
|
||||
// setup stack
|
||||
move.l #AMIGA_ZBEOS_STACK_END,%sp
|
||||
|
||||
lea h5,%a0
|
||||
bsr puts
|
||||
lea _bs_entry,%a0
|
||||
move.l %a0,%d0
|
||||
bsr putx
|
||||
|
||||
// copy the rest of the prg
|
||||
|
||||
// load counter
|
||||
clr.l %d0
|
||||
move.w sNumSectors,%d0
|
||||
sub.w #1,%d0
|
||||
// load addresses
|
||||
lea _bs_entry,%a0
|
||||
move.l #AMIGA_ZBEOS_BASE,%a1
|
||||
|
||||
|
||||
nextsect:
|
||||
move.l #512/4-1,%d1
|
||||
copysect_loop:
|
||||
move.l (%a0)+,(%a1)+
|
||||
dbf %d1,copysect_loop
|
||||
//bsr putx
|
||||
dbf %d0,nextsect
|
||||
|
||||
lea msg_j1,%a0
|
||||
bsr puts
|
||||
// all done
|
||||
super_done:
|
||||
// XXX: copy the rest !
|
||||
move.b #AMIGA_BOOT_DRVAPI_FLOPPY,AMIGA_ZBEOS_BASE + gBootDriveAPI - _bs_entry
|
||||
|
Loading…
x
Reference in New Issue
Block a user