- Timestamp:
- 08/07/2017 02:04:35 PM (7 years ago)
- Branches:
- master
- Children:
- 27c8d40
- Parents:
- 84c0125
- Location:
- rom
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
rom/bios.s
r84c0125 r8325447 44 44 45 45 .xref start_ | Where ROMP starts 46 .xref _errno | Start of ROMP bss space46 .xref errno | Start of ROMP bss space 47 47 48 48 .xdef basepage | Pseudo base page for romp 49 .xdef _rsflag | Register save area overflow flag49 .xdef rsflag | Register save area overflow flag 50 50 51 51 .ifne BUCHLA 52 52 53 .xdef _hdvini | Disk init54 55 .endc 56 57 .xdef _wzcrsh | ROMP crash flag58 .xdef _crshvc | Crash vector59 .xdef _crshsr | Crash SR60 .xdef _crshpc | Crash PC61 .xdef _crshsp | Crash SP62 .xdef _crshus | Crash USP63 .xdef _crshrg | Crash SP registers64 .xdef _crshst | Crash top of stack53 .xdef hdvini | Disk init 54 55 .endc 56 57 .xdef wzcrsh | ROMP crash flag 58 .xdef crshvc | Crash vector 59 .xdef crshsr | Crash SR 60 .xdef crshpc | Crash PC 61 .xdef crshsp | Crash SP 62 .xdef crshus | Crash USP 63 .xdef crshrg | Crash SP registers 64 .xdef crshst | Crash top of stack 65 65 66 66 .page … … 68 68 .ifne BUCHLA 69 69 70 .xdef _hz_1k71 .xdef _hz_20070 .xdef hz_1k 71 .xdef hz_200 72 72 .xdef frclock 73 73 .xdef t1count … … 516 516 move.l #timeint,0x0070 | Set timer trap vector 517 517 518 move.l # _hdvini,hdv_init | Set disk init vector518 move.l #hdvini,hdv_init | Set disk init vector 519 519 move.l #getbpb,hdv_bpb | Set get BPB vector 520 520 move.l #rwabs,hdv_rw | Set disk I/O vector … … 644 644 move.w #INITIPL,sr | Enable interrupts 645 645 lea basepage,a1 | Pass start_ a pseudo base page 646 move.l # _errno,p_bbase(a1) | ...646 move.l #errno,p_bbase(a1) | ... 647 647 clr.l p_blen(a1) | ... 648 648 move.l a1,-(a7) | ... … … 679 679 | badtrap -- Bad trap handler 680 680 | ------- ---------------- 681 badtrap: move.w (a7)+, _crshsr | Get crash SR682 move.l (a7)+, _crshpc | Get crash PC683 move.l a7, _crshsp | Get crash SP681 badtrap: move.w (a7)+,crshsr | Get crash SR 682 move.l (a7)+,crshpc | Get crash PC 683 move.l a7,crshsp | Get crash SP 684 684 bsr badtr1 | Get TRAP PC with vector number 685 685 nop 686 686 687 badtr1: move.l (a7)+, _crshvc | Save for analysis of vector #688 movem.l d0-d7/a0-a7, _crshrg | Save crash registers687 badtr1: move.l (a7)+,crshvc | Save for analysis of vector # 688 movem.l d0-d7/a0-a7,crshrg | Save crash registers 689 689 move.l usp,a0 | Preserve crash USP 690 move.l a0, _crshus | ...690 move.l a0,crshus | ... 691 691 move.l a7,d0 | Get SP 692 692 andi.l #0xFFFFFFFE,d0 | ... make sure it's even 693 693 movea.l d0,a1 | ... 694 694 move.w #15,d0 | Save top 16 words 695 lea _crshst,a0 | ... of crash stack in _crshst695 lea crshst,a0 | ... of crash stack in crshst 696 696 697 697 badtr2: move.w (a1)+,(a0)+ | Save a stack value … … 699 699 700 700 clr.l d0 | Get TRAP number 701 move.b _crshvc,d0 | ... as LS byte of d0702 move.l _crshpc,a0 | Save crash PC in a0703 move.w #0xFFFF, _wzcrsh | Indicate we crashed701 move.b crshvc,d0 | ... as LS byte of d0 702 move.l crshpc,a0 | Save crash PC in a0 703 move.w #0xFFFF,wzcrsh | Indicate we crashed 704 704 move.l #rsarea,savptr | Restore system save pointer 705 705 move.l #SSTACK,a7 | Reset the stack pointer … … 725 725 move.w d1,t3count | ... and save it 726 726 727 addq.l #1, _hz_1k | Update 1ms clock (1 KHz)727 addq.l #1,hz_1k | Update 1ms clock (1 KHz) 728 728 729 729 move.w tdiv1,d1 | Update divider … … 731 731 move.w d1,tdiv1 | ... 732 732 733 cmpi.w #5,d1 | Do we need to update _hz_200 ?733 cmpi.w #5,d1 | Do we need to update hz_200 ? 734 734 blt tmi02 | Jump if not 735 735 736 addq.l #1, _hz_200 | Update 5ms clock (200 Hz)736 addq.l #1,hz_200 | Update 5ms clock (200 Hz) 737 737 738 738 move.w tdiv2,d1 | Update divider … … 1611 1611 .page 1612 1612 1613 | _hdvini -- Drive initialization1614 | ------ ---------------------1615 _hdvini:link a6,#-18 | Reserve space on stack1613 | hdvini -- Drive initialization 1614 | ------ -------------------- 1615 hdvini: link a6,#-18 | Reserve space on stack 1616 1616 movem.l d3-d7/a3-a5,-(a7) | Preserve registers 1617 1617 move.l #300,maxactim | maxactim = 300 * 20ms … … 1837 1837 move.b #1,(a5) | Set dskmode to "Uncertain" 1838 1838 1839 media4: move.l _hz_200,d0 | Get time in d01839 media4: move.l hz_200,d0 | Get time in d0 1840 1840 movea.w d7,a1 | Calculate acctim table address 1841 1841 add.l a1,a1 | ... = drive # * 4 … … 2734 2734 lsl.w #2,d0 | Use as index 2735 2735 lea acctim(a5),a0 | ... into acctim 2736 move.l _hz_200(a5),0(a0,d0) | Set last access time2736 move.l hz_200(a5),0(a0,d0) | Set last access time 2737 2737 cmp.w #1,nflops(a5) 2738 2738 bne flopok01 2739 2739 2740 move.l _hz_200(a5),4(a0) | Time for other drive2740 move.l hz_200(a5),4(a0) | Time for other drive 2741 2741 2742 2742 flopok01: move.w flpsrsv,sr | Restore sr (enable ints) … … 2913 2913 bootload: link a6,#0 | Link stack frames 2914 2914 movem.l d6-d7,-(a7) | Save registers 2915 jsr _hdvini | Init drive2915 jsr hdvini | Init drive 2916 2916 tst.w nflops | See if any connected 2917 2917 beq bootld01 | Jump if drive there … … 3046 3046 bne rand01 | Jump if not 3047 3047 3048 move.l _hz_200,d0 | Pick up the 200 Hz clock3048 move.l hz_200,d0 | Pick up the 200 Hz clock 3049 3049 moveq.l #16,d1 | Shift it left 3050 3050 asl.l d1,d0 | ... 3051 or.l _hz_200,d0 | OR in current 200 Hz clock3051 or.l hz_200,d0 | OR in current 200 Hz clock 3052 3052 move.l d0,rseed | Use that as the seed 3053 3053 … … 3688 3688 fc_val: .ds.l 1 | Frame clock value (0..FCMAX) 3689 3689 3690 _wzcrsh:.ds.w 1 | Crash area: flag for ROMP3691 _crshsr:.ds.w 1 | Crash area: SR3692 _crshpc:.ds.l 1 | Crash area: PC3693 _crshsp:.ds.l 1 | Crash area: SP3694 _crshus:.ds.l 1 | Crash area: USP3695 _crshvc:.ds.l 1 | Crash area: vector # in MS byte3696 _crshrg:.ds.l 16 | Crash area: registers3697 _crshst:.ds.w 16 | Crash area: top 16 words of stack3690 wzcrsh: .ds.w 1 | Crash area: flag for ROMP 3691 crshsr: .ds.w 1 | Crash area: SR 3692 crshpc: .ds.l 1 | Crash area: PC 3693 crshsp: .ds.l 1 | Crash area: SP 3694 crshus: .ds.l 1 | Crash area: USP 3695 crshvc: .ds.l 1 | Crash area: vector # in MS byte 3696 crshrg: .ds.l 16 | Crash area: registers 3697 crshst: .ds.w 16 | Crash area: top 16 words of stack 3698 3698 3699 3699 | The area from biosram to SSTACK-1 is cleared on reset. … … 3703 3703 .ifne BUCHLA 3704 3704 3705 _hz_1k: .ds.l 1 | 1000 Hz clock3706 _hz_200:.ds.l 1 | 200 Hz clock3705 hz_1k: .ds.l 1 | 1000 Hz clock 3706 hz_200: .ds.l 1 | 200 Hz clock 3707 3707 frclock: .ds.l 1 | 50 Hz clock 3708 3708 t1count: .ds.w 1 | Timer 1 count … … 3758 3758 fverify: .ds.w 1 | Floppy verify flag 3759 3759 3760 tdiv1: .ds.w 1 | Timer divider 1 (divides _hz_1k)3761 tdiv2: .ds.w 1 | Timer divider 2 (divides _hz_200)3760 tdiv1: .ds.w 1 | Timer divider 1 (divides hz_1k) 3761 tdiv2: .ds.w 1 | Timer divider 2 (divides hz_200) 3762 3762 3763 3763 retrycnt: .ds.w 1 | Re-try count -
rom/lowram.s
r84c0125 r8325447 20 20 | ... -text- 21 21 | ... 22 | _etext end of 'text' area + 123 | basedat start of 'data' area (will usually be _etext)22 | etext end of 'text' area + 1 23 | basedat start of 'data' area (will usually be etext) 24 24 | ... 25 25 | ... -data- 26 26 | ... 27 | _edata end of 'data' area + 128 | basebss start of 'bss' area (will usually be _edata)27 | edata end of 'data' area + 1 28 | basebss start of 'bss' area (will usually be edata) 29 29 | ... 30 30 | ... -BSS- 31 31 | ... 32 | _end end of actual 'bss' area + 132 | end end of actual 'bss' area + 1 33 33 | ... 34 34 | ... -heap- … … 55 55 56 56 .xdef LOWRAM 57 .xdef _Lo_RAM58 .xdef _Hi_RAM57 .xdef Lo_RAM 58 .xdef Hi_RAM 59 59 60 60 .xdef basebss … … 63 63 .xdef p_env 64 64 65 .xdef _p_tlen66 .xdef _p_dlen65 .xdef p_tlen 66 .xdef p_dlen 67 67 68 68 | Globals referred to here: 69 69 70 70 .xref start_ | entry point in fsmain.s 71 .xref _panic | entry point in fsmain.s71 .xref panic | entry point in fsmain.s 72 72 73 .xref _edata | supplied by loader74 .xref _etext | supplied by loader73 .xref edata | supplied by loader 74 .xref etext | supplied by loader 75 75 76 76 | ------------------------------------------------------------------------------ 77 77 | Memory setup: 78 | ------------ 78 | ------------- 79 79 | The equate for HI_RAM must be set to match the memory configuration used. 80 80 … … 88 88 | LOWRAM -- Startup code for Buchla 700 application programs 89 89 | ------ ------------------------------------------------ 90 _Lo_RAM:90 Lo_RAM: 91 91 LOWRAM: lea basebss,a0 | setup bss base 92 92 move.l a0,p_bbase | ... … … 97 97 lea basedat,a0 | setup data base 98 98 move.l a0,p_dbase | ... 99 lea _edata,a1 | setup data length99 lea edata,a1 | setup data length 100 100 suba.l a0,a1 | ... 101 101 move.l a1,p_dlen | ... … … 103 103 lea start_,a0 | setup text base 104 104 move.l a0,p_tbase | ... 105 lea _etext,a1 | setup text length105 lea etext,a1 | setup text length 106 106 suba.l a0,a1 | ... 107 107 move.l a1,p_tlen | ... … … 118 118 119 119 move.l #pmsg,-(a7) | OOPS: panic() 120 jsr _panic | ... shouldn't ever return120 jsr panic | ... shouldn't ever return 121 121 addq.l #4,a7 122 122 … … 148 148 BPLEN = current-p_lowtpa | MUST be 0x0100 (or we goofed) 149 149 150 _p_tlen = p_tlen | text length for MIDAS-VII151 _p_dlen = p_dlen | data length for MIDAS-VII152 153 150 | ------------------------------------------------------------------------------ 154 151 .data
Note:
See TracChangeset
for help on using the changeset viewer.