/
bios.asm
4170 lines (2863 loc) · 91.9 KB
/
bios.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; Ralf Brown's Interrupt List has some information on the T2K here:
; http://www.ctyme.com/intr/cat-044.htm
;
; It documents calls that are not in this disassmbled BIOS. I can
; only assume the DOS bootstrap contains supplemental BIOS support.
; Otherwise, there are an aweful lot of interrupt handlers in this
; code that do effectively nothing but iret. It seems a waste of
; perfectly good hardware.
;
; The fact disk routines here have no write support means a BIOS
; supplement must be coming from the DOS boot-strap. Also the
; video BIOS only implements set/get character set and teletype
LF equ 10
FF equ 12
CR equ 13
SPACE equ 32
NORMAL_CHAR_ATTR equ 00ah ; No blink, reg intensity, normal
LBDA_SEG equ 00000h
EBDA_OS_OFFSET equ 0064h ; [W] OS jump offset
LBDA_HDDA_SEGMENT equ 040eh ; [W] Pointer to disk context
LBDA_PCB_REVISION equ 0420h ; [B]
LBDA_GRAPHICS_CONFIG equ 0422h ; [W] Graphics config bits
LBDA_RAMEND_UPPER equ 0424h ; [W] Upper 16 bits
LBDA_RAMEND_LOWER equ 0426h ; [W] Lower 4 bits
LBDA_RAMEND_TOP equ 0428h ; [W] Appears to be same as upper
LBDA_TEXT_FB_OFF equ 042ah ; [W]Text frame buffer offset
LBDA_TEXT_FB_SEG equ 042ch ; [W]Text frame buffer seg
LBDA_SYS_FAULT equ 0432h ; [W]
LBDA_UNK_07 equ 0442h ; [B] MBR from 0 FDC, 2 HDC
LBDA_OS_OFFSET equ 0444h ; [W] OS jump offset
LBDA_OS_SEGMENT equ 0446h ; [W] OS jump segment
LBDA_DMA_MUX_CTRL equ 044ah ; [B]
LBDA_VIDEO_FB_OFF equ 0472h ; [W] Text frame buffer offset
LBDA_VIDEO_FB_SEG equ 0474h ; [W] Text frame buffer seg
LBDA_VIDEO_CSET_BASE equ 0476h ; [D]
LBDA_VIDEO_CSET_8X8_LOWER_PTR equ 0476h ; [D]
LBDA_VIDEO_CSET_8X8_UPPER_PTR equ 047ah ; [D]
LBDA_VIDEO_CSET_8X16_LOWER_PTR equ 047eh ; [D]
LBDA_VIDEO_CSET_8X16_UPPER_PTR equ 0482h ; [D]
LBDA_CFG_VIDEO_FB equ 0486h ; [B] port 101h reg value (FB)
LBDA_CFG_PORT0 equ 0487h ; [B] port 0 reg value
LBDA_FDC_BOOT_RETRIES equ 048ah ; [B]
LBDA_HDC_BOOT_RETRIES equ 048bh ; [B]
EBDA_SEG equ 01800h
EBDA_MEMSIZE equ 0000h ; in 64KB pages
EBDA_UNK_02 equ 0002h ;
EBDA_ROM_CHECKSUM equ 0004h ; [W] ROM checksum
EBDA_RAMTEST_OFFSET equ 0006h ; [W] segment offset of end
EBDA_RAMTEST_ENDSEG equ 0008h ; [W] segment where ended
EBDA_RAMTEST_PATTERN equ 000ah ; [W] Last pattern written
EBDA_RAMTEST_ENDADDR equ 000ch ; [W] Upper 16 bits of end
EBDA_ISR_COUNTS equ 0020h ; No longer used
EBDA_ISR_COUNT_PARITY equ 0020h ; No longer used
EBDA_ISR_COUNT_BUS_TIMEOUT equ 0022h ; No longer used
EBDA_ISR_COUNT_UART equ 0024h ; No longer used
EBDA_ISR_COUNT_SDLC equ 0026h ; No longer used
EBDA_ISR_COUNT_FDC equ 0028h ; No longer used
EBDA_ISR_COUNT_NETWORK equ 002ah ; No longer used
EBDA_ISR_COUNT_HDC_PRI equ 002ch ; No longer used
EBDA_ISR_COUNT_HDC_SEC equ 002eh ; No longer used
EBDA_ISR_COUNT_KEYBOARD equ 0030h ; No longer used
EBDA_ISR_COUNT_CRT equ 0032h ; No longer used
EBDA_VIDEO_CURSOR_POS equ 0040h ; [W] MSB row, LSB col
EBDA_VIDEO_BG_TEXT_ATTR equ 0042h ; [B] Current teletype attribute
EBDA_VIDEO_FG_TEXT_ATTR equ 0043h ; [B] Current teletype attribute
EBDA_OS_SEGMENT equ 0066h ; [W] OS jump segment
CRT_CHARSET_SEG equ 0f800h
MBR_LOAD_SEG equ 01b00h
CONFIG_REV equ 00h ; PCB rev resistor strappings
CONFIG_MAXRAM equ 01h ; in 64KB blocks
CONFIG_UMCS equ 02h ; defines ROM starting address
CONFIG_128K_VIDEO equ 04h ; Base for mem-sized value for 101h
CONFIG_128K_PORT0 equ 05h ; Base for mem-sized value for 0h
_TEXT segment word public use16 'CODE'
public _entry
public _init_entry
assume cs:_TEXT, ds:nothing, es:nothing
org 00000h
_init_entry:
cli
cld
jmp _init
nop
_str_copyright: ; Unreferenced by code - placed here as a signature
db 'BOOT ROM version 02.00.00', CR, LF
db 'Copyright 1983,84 Tandy Corp.', CR, LF
db 'All rights reserved.', CR, LF, 0ffh
_init:
; Setup a working stack
mov ax, 0050h
mov ss, ax
mov sp, 0100h
; Make sure there is an iret at NMI location
mov ax, 0
mov ds, ax
mov word ptr ds:[008h], offset _isr_nmi
mov word ptr ds:[00ah], cs
; Rev.3 turns on bit 5 - not sure of the meaning atm
mov al, cs:[bp + CONFIG_128K_PORT0]
mov dx, 0
out dx, al
; PIT control: Timer 2 (DRAM refresh) -> LE, Mode 2 (rate gen)
mov al, 0b4h
mov dx, 0046h
out dx, al
nop
nop
; Load Timer 2 count (LE) = 001fh -> 2 MHz / 31 = 15.5us rate
mov al, 1fh
mov dx, 0044h
out dx, al
nop
nop
mov al, 0
mov dx, 0044h
out dx, al
nop
nop
; Perform a RAM sizing loop
cld
mov bh, 0eh ; count to 896K (64K * 14)
mov bl, 0 ; current count
mov ax, 0 ; Start at 0000:0000
mov ds, ax
mov si, 0
_ramsize_loop:
mov ax, 5a5ah
mov ds:[si], ax
; delay - why? RAM settling time?
mov cx, 1000
_init_delay1:
loop _init_delay1
cmp ax, ds:[si]
jne _ramsize_done
not ax
mov ds:[si], ax
mov cx, 1000
_init_delay2:
loop _init_delay2
cmp ax, ds:[si]
jne _ramsize_done
mov ax, ds
add ax, 1000h ; +64KB
mov ds, ax
inc bl
cmp bl, bh
jb _ramsize_loop
_ramsize_done:
; This forces ram size to a minimum of 128K but it does it
; regardless if things passed or not. Not sure why it doesn't
; fail here if the first 128KB failed to hold content in the
; first word. But it doesn't hurt to let the test pass fail.
cmp bl, 2
jae _ramtest_setup
mov bl, 2
_ramtest_setup:
; Set the test size (64K page count) to what was sized
mov bh, bl
mov bl, 0
; Reset the starting pointer past NMI vector for first page
mov ax, 0
mov ds, ax
mov si, 000ch
mov cx, 7ffah
jmp _ramtest_start
_ramtest_next:
; Subsequent pages start at begining
mov si, 0
mov cx, 08000h
_ramtest_start:
mov dx, 5a5ah
_ramtest_loop:
mov ds:[si], dx
nop
lodsw
cmp ax, dx
jne _ramtest_failed
inc dl
dec dh
nop
nop
loop _ramtest_loop
; next 64KB page
mov ax, ds
add ax, 1000h
mov ds, ax
inc bl
cmp bl, bh
jc _ramtest_next
jmp _ramtest_clip
_ramtest_failed:
; Again, this forces ram size to a minimum of 128K even on
; failure. Not sure why. The config table for RAM sizing
; does require a start of di=2, so that may be why - for
; alignment purposes
cmp bl, 2
jae _ramtest_failed_adj
mov bl, 2
_ramtest_failed_adj:
; Adjust pointer back to the place that failed
dec si
mov cl, dh
mov ch, ah
cmp al, dl
jz _ramtest_clip
dec si
mov cl, dl
mov ch, al
_ramtest_clip:
mov al, cs:[bp + CONFIG_MAXRAM]
cmp bl, al
jbe _ramtest_done
mov bl, al
_ramtest_done:
; This rounds down the size to 128KB border and indexes
; the config table for a value to write to port 101h which
; is the frame buffer start address and then port 0 which
; controls speaker, resets, and clock gating
and bl, 0feh
mov bh, 0
mov di, bx
mov ax, cs:[bp + di + CONFIG_128K_VIDEO - 2]
mov dx, 0101h
out dx, al
mov al, ah
mov dx, 0
out dx, al
; ds points to first segment after end of RAM -> dx
mov dx, ds
mov ax, EBDA_SEG
mov ds, ax
mov ax, LBDA_SEG
mov es, ax
mov al, cs:[bp + CONFIG_REV]
mov es:[LBDA_PCB_REVISION], al
mov bh, 0
mov ds:[EBDA_MEMSIZE], bx
mov di, bx
mov ax, cs:[bp + di + CONFIG_128K_VIDEO - 2]
mov es:[LBDA_CFG_VIDEO_FB], al
mov es:[LBDA_CFG_PORT0], ah
mov word ptr es:[LBDA_SYS_FAULT], 0
mov ds:[EBDA_RAMTEST_OFFSET], si
mov ds:[EBDA_RAMTEST_ENDSEG], dx
mov ds:[EBDA_RAMTEST_PATTERN + 0], cl
mov ds:[EBDA_RAMTEST_PATTERN + 1], ch
mov ax, si
shr ax, 04h
add ax, dx
mov ds:[EBDA_RAMTEST_ENDADDR], ax
cmp ax, 2000h
jae _ramtest_seg_ok
mov ax, 2000h
jmp _ramtest_sysfault
_ramtest_seg_ok:
test ax, 1fffh
jz _ramtest_off_ok
and ax, 0e000h
jmp _ramtest_sysfault
_ramtest_off_ok:
cmp si, 0
jz _ramtest_good
_ramtest_sysfault:
; or word ptr es:[LBDA_SYS_FAULT], 20h
db 026h, 081h, 00eh, 032h, 004h, 020h, 000h ; fixup
_ramtest_good:
; ax = top 16 bits of end of ram
mov es:[LBDA_RAMEND_UPPER], ax
mov word ptr es:[LBDA_RAMEND_LOWER], 0
mov es:[LBDA_RAMEND_TOP], ax
sub ax, 0140h ; 5 KB
mov word ptr es:[LBDA_VIDEO_FB_OFF], 0
mov es:[LBDA_VIDEO_FB_SEG], ax
mov word ptr es:[LBDA_TEXT_FB_OFF], 0
mov es:[LBDA_TEXT_FB_SEG], ax
; Verify ROM checksum
mov si, 0
mov cx, 1000h ; 4K words
xor ax, ax
_rom_checksum:
add al, cs:[si]
inc si
add ah, cs:[si]
inc si
loop _rom_checksum
mov ds:[EBDA_ROM_CHECKSUM], ax
or ax, ax
jz _rom_checksum_ok
; or word ptr es:[LBDA_SYS_FAULT], 10h
db 26h, 081h, 0eh, 32h, 04h, 10h, 00h
_rom_checksum_ok:
mov ax, LBDA_SEG
mov ds, ax
mov dx, 0180h ; Hi-res graphics option status reg
in al, dx
mov cl, 28h
mov ch, 21h
cmp al, 0ffh
je _graphics_done ; Not installed
test al, 1
jz _crt_set_colors
or cl, 1
or ch, 4
jmp _graphics_done
_crt_set_colors:
push ax
mov dx, 0198h ; Background high intensity color = 0
mov al, 0
out dx, al
mov dx, 019ah ; Character high intensity color = 15
mov al, 15
out dx, al
mov dx, 019ch ; Background low intensity color = 0
mov al, 0
out dx, al
mov dx, 019eh ; Character low intensity color = 7
mov al, 7
out dx, al
pop ax
test al, 20h
jnz _graphics_rev2
test al, 2
jnz _graphics_3planes
or cl, 2
jmp _graphics_ext
_graphics_3planes:
or cl, 4
jmp _graphics_ext
_graphics_rev2:
or cl, 6
_graphics_ext:
or ch, 2
_graphics_done:
mov ds:[LBDA_GRAPHICS_CONFIG], cx
; This places _TEXT:_isr_default from vector 3 to 255
mov ax, cs
mov ds, ax
mov ax, 0
mov es, ax
cld
mov di, 000ch
mov cx, 00fdh
_setup_default_vectors:
mov ax, _isr_default
stosw
mov ax, _TEXT
stosw
loop _setup_default_vectors
mov si, _initial_vectors
nop
_setup_specific_vectors:
lodsw
; cmp ax, 0ffffh
db 03dh, 0ffh, 0ffh ; fixup
jz _setup_io
mov di, ax
movsw
jmp _setup_specific_vectors
_setup_io:
mov ax, cs
mov ds, ax
mov si, _portlist_pici
nop
call _program_io_list
mov si, _portlist_pic1
nop
call _program_io_list
mov si, _portlist_pic2
nop
call _program_io_list
mov ax, cs
mov es, ax
; Set lower 128 chars 8x8
mov bx, _char_table_8x8
nop
mov al, 1
mov ah, 10h
int 52h
; Set upper 128 chars 8x8
mov bx, _char_table_8x8
nop
mov al, 3
mov ah, 10h
int 52h
; Set lower 128 chars 8x16
mov bx, _char_table_8x16
nop
mov al, 5
mov ah, 10h
int 52h
; Set upper 128 chars 8x16
mov bx, _char_table_8x16
nop
mov al, 7
mov ah, 10h
int 52h
; Initialize CRT controller
mov ax, EBDA_SEG
mov ds, ax
mov bl, NORMAL_CHAR_ATTR
call _clear_screen
mov ax, cs
mov ds, ax
mov si, _portlist_crt
nop
call _program_io_list
cld
mov ax, cs
mov ds, ax
mov ax, EBDA_SEG
mov es, ax
mov ax, 0
mov di, EBDA_ISR_COUNTS
mov cx, 10
rep stosw
sti
call _print_memsize
call _delay_big
mov ax, EBDA_SEG
mov ds, ax
mov ax, LBDA_SEG
mov es, ax
mov word ptr ds:[EBDA_UNK_02], 0
mov byte ptr es:[LBDA_FDC_BOOT_RETRIES], 10
mov byte ptr es:[LBDA_HDC_BOOT_RETRIES], 10
push ds
push es
call _boot_fdc
pop es
pop ds
jc _try_hdc
mov al, 0
call _chain_to_dos
_try_hdc:
push ds
push es
call _boot_hdc
pop es
pop ds
jc _halt_and_catch_fire
mov al, 2
call _chain_to_dos
_halt_and_catch_fire:
jmp _halt_and_catch_fire
org 00314h
_chain_to_dos proc near public
push ds
push es
mov es:[LBDA_UNK_07], al
mov ax, ds:[19h * 4 + 0]
mov es:[LBDA_OS_OFFSET], ax
mov ax, ds:[19h * 4 + 2]
mov es:[LBDA_OS_SEGMENT], ax
; Jump to DOS bootstrap - does not return unless controlled failure
mov es, ax
callf dword ptr ds:[19h * 4] ; jmp to int 19h
pop es
pop ds
ret
_chain_to_dos endp
_boot_failed_1:
jmp $+2
_boot_failed_2:
stc
jmp _boot_done
_boot_ok:
clc
_boot_done:
ret
org 00338h
_boot_defaults proc near public
mov word ptr ds:[14h * 4 + 0], cx
mov word ptr ds:[14h * 4 + 2], cx
mov word ptr ds:[19h * 4 + 0], 0
mov word ptr ds:[19h * 4 + 2], MBR_LOAD_SEG
mov word ptr ds:[18h * 4 + 0], 0
mov word ptr ds:[18h * 4 + 2], MBR_LOAD_SEG
ret
_boot_defaults endp
org 00359h
_boot_fdc proc near public
mov cx, 1000
call _boot_defaults
call _fdc_install
_boot_fdc_try:
mov dl, 0 ; Floppy A:
mov ah, 0 ; Reset drive
int 56h
or ah, ah
jnz _boot_fdc_check_sts_2
mov dh, 0 ; Head 0
mov dl, 0 ; Floppy A:
mov ch, 0 ; Track 0
mov cl, 1 ; Sector 1
mov al, 1 ; 1 Sector
les bx, ds:[18h * 4] ; int 18h pointer
mov ah, 2 ; read sectors
int 56h
or ah, ah
jz _boot_fdc_check_sts_1
dec byte ptr es:[LBDA_FDC_BOOT_RETRIES]
jnz _boot_fdc_try
jmp _boot_fdc_failed
nop
_boot_fdc_check_sts_1:
cmp al, 1
jnz _boot_fdc_failed
jmp _boot_ok
_boot_fdc_check_sts_2:
test ah, 7fh
jnz _boot_fdc_failed
jmp _boot_failed_2
_boot_fdc_failed:
jmp _boot_failed_1
_boot_fdc endp
org 0039bh
_boot_hdc proc near public
mov cx, 1000
call _boot_defaults
call _hdc_install
_boot_hdc_try:
mov dl, 080h ; Hard drive C:
mov ah, 0 ; Reset drive
int 56h
or ah, ah
jnz _boot_hdc_failed
mov dh, 0 ; Head 0
mov dl, 080h ; Hard drive C:
mov ch, 0 ; Cylinder 0
mov cl, 1 ; Sector 1
mov al, 1 ; 1 Sector
les bx, ds:[18h * 4] ; int 18h pointer
mov ah, 2 ; read sectors
int 56h
or ah, ah
jz _boot_hdc_check_sts
dec byte ptr es:[LBDA_HDC_BOOT_RETRIES]
jnz _boot_hdc_try
jmp _boot_hdc_failed
nop
_boot_hdc_check_sts:
cmp al, 1
jnz _boot_hdc_failed
jmp _boot_ok
_deadlabel_1:
jmp _boot_failed_2
_boot_hdc_failed:
jmp _boot_failed_1
_boot_hdc endp
org 003dbh
public _isr_nmi
public _isr_default
public _isr_cpu_fault
public _isr_spurious ; this is actually bad is it does not EOI
public _isr_fault_unk_1
public _isr_fault_unk_2
public _isr_fault_unk_3
_isr_nmi:
iret
_isr_default:
push ax
mov ax, 1
jmp _isr_sysfault
_isr_cpu_fault:
push ax
mov ax, 2
jmp _isr_sysfault
_isr_spurious:
push ax
mov ax, 4
jmp _isr_sysfault
_isr_fault_unk_1:
push ax
mov ax, 8
jmp _isr_sysfault
_isr_fault_unk_2:
push ax
mov ax, 0040h
jmp _isr_sysfault
_isr_fault_unk_3:
push ax
mov ax, 0080h
_isr_sysfault:
push ds
push bx
mov bx, LBDA_SEG
mov ds, bx
or ds:[LBDA_SYS_FAULT], ax
pop bx
pop ds
pop ax
iret
org 0040dh
_isr_default_pic0 proc near public
sti
push ds
pusha
call _pic0_eoi
popa
pop ds
iret
_isr_default_pic0 endp
org 00416h
_isr_default_pic1 proc near public
sti
push ds
pusha
call _pic1_eoi
popa
pop ds
iret
_isr_default_pic1 endp
org 0041fh
_isr_parity_error proc near public
sti
push ds
pusha
mov si, EBDA_ISR_COUNT_PARITY
call _isr_update_count
jz $+2
call _pici_eoi
popa
pop ds
iret
_isr_parity_error endp
org 00430h
_isr_fdc_old proc near public
sti
push ds
pusha
mov si, EBDA_ISR_COUNT_FDC
call _isr_update_count
jz $+2
call _pic0_eoi
popa
pop ds
iret
_isr_fdc_old endp
org 00441h
_isr_hdc proc near public
sti
push ds
pusha
mov si, EBDA_ISR_COUNT_HDC_PRI
call _isr_update_count
jz $+2
call _pic0_eoi
popa
pop ds
iret
_isr_hdc endp
org 00452h
_isr_keyboard proc near public
sti
push ds
pusha
mov si, EBDA_ISR_COUNT_KEYBOARD
call _isr_update_count
jz $+2
call _pic1_eoi
popa
pop ds
iret
_isr_keyboard endp
org 00463h
_isr_crt proc near public
sti
push ds
pusha
mov si, EBDA_ISR_COUNT_CRT
call _isr_update_count
jz $+2
call _pic1_eoi
popa
pop ds
iret
_isr_crt endp
; This appears to have increamented WORD counters in the EBDA to
; record ISR counts. But the code is gone or was commented out.
org 00474h
_isr_update_count proc near public
mov ax, EBDA_SEG
mov ds, ax
mov ax, 0ffffh
jmp _isr_update_count_done
_isr_update_count_unreachable:
mov ax, 0
_isr_update_count_done: