-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbios.lst
10718 lines (10718 loc) · 704 KB
/
bios.lst
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
1 ;=========================================================================
2 ; main.asm - BIOS main file
3 ; Skeleton for the BIOS
4 ; Power On Self Test (POST)
5 ; Interrupt table setup
6 ; INT 11h - Get equipment list
7 ; INT 12h - Get memory size
8 ;-------------------------------------------------------------------------
9 ;
10 ; Compiles with NASM 2.07, might work with other versions
11 ;
12 ; Copyright (C) 2011 - 2014 Sergey Kiselev.
13 ; Provided for hobbyist use on the Xi 8088 board.
14 ;
15 ; This program is free software: you can redistribute it and/or modify
16 ; it under the terms of the GNU General Public License as published by
17 ; the Free Software Foundation, either version 3 of the License, or
18 ; (at your option) any later version.
19 ;
20 ; This program is distributed in the hope that it will be useful,
21 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ; GNU General Public License for more details.
24 ;
25 ; You should have received a copy of the GNU General Public License
26 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
27 ;
28 ;=========================================================================
29
30 ;-------------------------------------------------------------------------
31 ; Fixed BIOS Entry Points
32 ; Source:
33 ; Intel(R) Platform Innovation Framework for EFI
34 ; Compatibility Support Module Specification
35 ; Section 5.2
36 ;
37 ; Location Description
38 ; -------- -----------
39 ; F000:E05B POST Entry Point
40 ; F000:E2C3 NMI Entry Point
41 ; F000:E401 HDD Parameter Table
42 ; F000:E6F2 INT 19 Entry Point
43 ; F000:E6F5 Configuration Data Table
44 ; F000:E729 Baut Rate Generator Table
45 ; F000:E739 INT 14 Entry Point
46 ; F000:E82E INT 16 Entry Point
47 ; F000:E987 INT 09 Entry Point
48 ; F000:EC59 INT 13 (Floppy) Entry Point
49 ; F000:EF57 INT 0E Entry Point
50 ; F000:EFC7 Floppy Disk Controller Parameter Table
51 ; F000:EFD2 INT 17
52 ; F000:F065 INT 10 (Video) Entry Point
53 ; F000:F0A4 INT 1D MDA and CGA Video Parameter Table
54 ; F000:F841 INT 12 Entry Point
55 ; F000:F84D INT 11 Entry Point
56 ; F000:F859 INT 15 Entry Point
57 ; F000:FA6E Low 128 Characters of Graphic Video Font
58 ; F000:FE6E INT 1A Entry Point
59 ; F000:FEA5 INT 08 Entry Point
60 ; F000:FF53 Dummy Interrupt Handler (IRET)
61 ; F000:FF54 INT 05 (Print Screen) Entry Point
62 ; F000:FFF0 Power-On Entry Point
63 ; F000:FFF5 ROM Date in ASCII "MM/DD/YY" Format (8 Characters)
64 ; F000:FFFE System Model (0xFC - AT, 0xFE - XT)
65
66 cpu 8086
67
68 %include "macro.inc"
69 <1> ;=========================================================================
70 <1> ; macro.inc - Defines macros
71 <1> ; setloc
72 <1> ;-------------------------------------------------------------------------
73 <1> ;
74 <1> ; Compiles with NASM 2.07, might work with other versions
75 <1> ;
76 <1> ; Copyright (C) 2011 - 2012 Sergey Kiselev.
77 <1> ; Provided for hobbyist use on the Xi 8088 board.
78 <1> ;
79 <1> ; This program is free software: you can redistribute it and/or modify
80 <1> ; it under the terms of the GNU General Public License as published by
81 <1> ; the Free Software Foundation, either version 3 of the License, or
82 <1> ; (at your option) any later version.
83 <1> ;
84 <1> ; This program is distributed in the hope that it will be useful,
85 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of
86 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
87 <1> ; GNU General Public License for more details.
88 <1> ;
89 <1> ; You should have received a copy of the GNU General Public License
90 <1> ; along with this program. If not, see <http://www.gnu.org/licenses/>.
91 <1> ;
92 <1> ;=========================================================================
93 <1>
94 <1> ;=========================================================================
95 <1> ; setloc - Set location. Insert 0FFh bytes until specifed location is reached.
96 <1> ;-------------------------------------------------------------------------
97 <1> %imacro setloc 1.nolist
98 <1> %assign pad_bytes (%1-($-$$)-START)
99 <1> %if pad_bytes < 0
100 <1> %assign over_bytes -pad_bytes
101 <1> %error Preceding code extends beyond setloc location by over_bytes bytes
102 <1> %endif
103 <1> %if pad_bytes > 0
104 <1> %warning Inserting pad_bytes bytes
105 <1> times pad_bytes db 0FFh
106 <1> %endif
107 <1> %endm
108 %include "config.inc"
109 <1> ;=========================================================================
110 <1> ; config.inc - Compilation time settings and settings
111 <1> ;-------------------------------------------------------------------------
112 <1> ;
113 <1> ; Compiles with NASM 2.07, might work with other versions
114 <1> ;
115 <1> ; Copyright (C) 2011 - 2014 Sergey Kiselev.
116 <1> ; Provided for hobbyist use on the Xi 8088 board.
117 <1> ;
118 <1> ; This program is free software: you can redistribute it and/or modify
119 <1> ; it under the terms of the GNU General Public License as published by
120 <1> ; the Free Software Foundation, either version 3 of the License, or
121 <1> ; (at your option) any later version.
122 <1> ;
123 <1> ; This program is distributed in the hope that it will be useful,
124 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of
125 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
126 <1> ; GNU General Public License for more details.
127 <1> ;
128 <1> ; You should have received a copy of the GNU General Public License
129 <1> ; along with this program. If not, see <http://www.gnu.org/licenses/>.
130 <1> ;
131 <1> ;=========================================================================
132 <1>
133 <1> %define DATE '05/28/14' ; BIOS release date MM/DD/YY
134 <1> %define VERSION '0.9.0' ; BIOS version
135 <1> %define START 8000h ; BIOS starts at offset 8000h
136 <1>
137 <1> %define AT_COMPAT ; AT-compatible system, two PICs
138 <1> %define PS2_MOUSE ; Enable PS/2 auxiliary device support
139 <1> %define DISABLE_KBD_DURING_INTERRUPTS ; Don't disable keyboard in INT1
140 <1> %define MIN_RAM_SIZE 32 ; At least 32 KiB to boot the system
141 <1> %define MAX_RAM_SIZE 640 ; Scan this much memory during POST
142 <1> %define RAM_TEST_BLOCK 16384 ; block size for RAM test
143 <1> %define EBDA_SIZE 1 ; 1KB reserved for EBDA
144 <1> ; EBDA is required for PS/2 aux support
145 <1> %define SLOW_FLOPPY ; turn off turbo during floppy I/O
146 %include "errno.inc"
147 <1> ;=========================================================================
148 <1> ; errno.inc - POST checkpoint codes (sent to port 80h during POST)
149 <1> ;-------------------------------------------------------------------------
150 <1> ;
151 <1> ; Compiles with NASM 2.07, might work with other versions
152 <1> ;
153 <1> ; Copyright (C) 2011 - 2014 Sergey Kiselev.
154 <1> ; Provided for hobbyist use on the Xi 8088 board.
155 <1> ;
156 <1> ; This program is free software: you can redistribute it and/or modify
157 <1> ; it under the terms of the GNU General Public License as published by
158 <1> ; the Free Software Foundation, either version 3 of the License, or
159 <1> ; (at your option) any later version.
160 <1> ;
161 <1> ; This program is distributed in the hope that it will be useful,
162 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of
163 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
164 <1> ; GNU General Public License for more details.
165 <1> ;
166 <1> ; You should have received a copy of the GNU General Public License
167 <1> ; along with this program. If not, see <http://www.gnu.org/licenses/>.
168 <1> ;
169 <1> ;=========================================================================
170 <1>
171 <1> e_boot equ 00h ; Boot the OS
172 <1> e_start equ 01h ; BIOS POST started
173 <1> e_cpu_ok equ 02h ; CPU test passed
174 <1> e_dmac_ok equ 03h ; DMAC initialized
175 <1> e_low_ram_ok equ 04h ; low RAM test passed
176 <1> e_int_ok equ 05h ; interrupt table initialized
177 <1> e_pit_ok equ 06h ; PIT (timer) initialized
178 <1> e_pic_ok equ 08h ; PIC initialized
179 <1> e_kbd_ok equ 10h ; KBD test passed
180 <1> e_video_bios_ok equ 11h ; Video BIOS found
181 <1> e_video_init_ok equ 12h ; Video BIOS initialized
182 <1> e_rtc_init_ok equ 20h ; RTC initialized
183 <1> e_cpu_detect_ok equ 21h ; CPU type detected
184 <1> e_fpu_detect_ok equ 22h ; FPU type detected
185 <1> e_serial_ok equ 24h ; Serial port scan finished
186 <1> e_parallel_ok equ 25h ; Parallel port scan finished
187 <1> e_ram_start equ 30h ; RAM test start
188 <1> e_ram_complete equ 31h ; RAM test completed
189 <1> e_ram_esc equ 32h ; RAM test canceled
190 <1> e_ext_start equ 40h ; Start BIOS extension ROM scan
191 <1> e_ext_detect equ 41h ; BIOS extension ROM found
192 <1> e_ext_init_ok equ 42h ; BIOS extension ROM initialized
193 <1> e_ext_complete equ 43h ; BIOS extension scan complete
194 <1> e_cpu_fail equ 52h ; CPU test failed
195 <1> e_low_ram_fail equ 54h ; low RAM test failed
196 <1> e_kbd_ctrl_fail equ 60h ; KBD test - controller selftest failed
197 <1> e_kbd_key_fail equ 61h ; KBD test - echo test failed
198 <1> e_kbd_timeout equ 62h ; KBD timeout
199 <1> e_kbd_int_fail equ 63h ; KBD test - interface test failed
200 <1> e_ram_fail equ 80h ; RAM test failed
201
202 bioscseg equ 0F000h
203 biosdseg equ 0040h
204
205 pic1_reg0 equ 20h
206 pic1_reg1 equ 21h
207 pit_ch0_reg equ 40h
208 pit_ch1_reg equ 41h
209 pit_ch2_reg equ 42h
210 pit_ctl_reg equ 43h
211 port_b_reg equ 61h
212 iochk_disable equ 08h ; clear and disable ~IOCHK NMI
213 refresh_flag equ 10h ; refresh flag, toggles every 15us
214 iochk_enable equ 0F7h ; enable ~IOCHK NMI
215 iochk_status equ 40h ; ~IOCHK status - 1 = ~IOCHK NMI signalled
216 post_reg equ 80h ; POST status output port
217 pic2_reg0 equ 0A0h
218 pic2_reg1 equ 0A1h
219 unused_reg equ 0C0h ; used for hardware detection and I/O delays
220 cga_mode_reg equ 3D8h
221 mda_mode_reg equ 3B8h
222
223 pic_freq equ 1193182 ; PIC input frequency - 14318180 MHz / 12
224
225 ;========================================================================
226 ; BIOS data area variables
227 ;------------------------------------------------------------------------
228 equip_serial equ 00h ; word[4] - addresses of serial ports
229 ; or 0 if port doesn't exist
230 equip_parallel equ 08h ; word[3] - addresses of parallel ports
231 ; or 0 if port doesn't exist
232 ebda_segment equ 0Eh ; word - address of EBDA segment
233 equipment_list equ 10h ; word - equpment list
234 equip_floppies equ 0000000000000001b ; floppy drivers installed
235 equip_fpu equ 0000000000000010b ; FPU installed
236 equip_mouse equ 0000000000000100b
237 equip_video equ 0000000000110000b ; video type bit mask
238 equip_color equ 0000000000100000b ; color 80x25 (mode 3)
239 equip_mono equ 0000000000110000b ; mono 80x25 (mode 7)
240 equip_floppy2 equ 0000000001000000b ; 2nd floppy drive installed
241 ; |||||||||||||||`-- floppy drives installed
242 ; ||||||||||||||`-- FPU installed
243 ; |||||||||||||`-- PS/2 mouse installed
244 ; ||||||||||||`-- reserved
245 ; ||||||||||`--- initial video mode
246 ; ||||||||`---- number of floppy drives - 1
247 ; |||||||`---- O = DMA installed
248 ; ||||`------ number of serial ports
249 ; |||`------ game adapter installed
250 ; ||`------ internal modem?!
251 ; `------- number of parallel ports
252
253 post_flags equ 12h ; byte - post flags
254 post_setup equ 01h ; run NVRAM setup
255 memory_size equ 13h ; word - memory size in KiB
256 kbd_flags_1 equ 17h ; byte - keyboard shift flags 1
257 kbd_flags_2 equ 18h ; byte - keyboard shift flags 2
258 kbd_alt_keypad equ 19h ; byte - work area for Alt+Numpad
259 kbd_buffer_head equ 1Ah ; word - keyboard buffer head offset
260 kbd_buffer_tail equ 1Ch ; word - keyboard buffer tail offset
261 kbd_buffer equ 1Eh ; byte[32] - keyboard buffer
262 fdc_calib_state equ 3Eh ; byte - floppy drive recalibration status
263 fdc_motor_state equ 3Fh ; byte - floppy drive motor status
264 fdc_motor_tout equ 40h ; byte - floppy drive motor off timeout (ticks)
265 fdc_last_error equ 41h ; byte - status of last diskette operation
266 fdc_ctrl_status equ 42h ; byte[7] - FDC status bytes
267 video_mode equ 49h ; byte - active video mode number
268 video_columns equ 4Ah ; word - number of text columns for active mode
269 video_page_size equ 4Ch ; word - size of video page in bytes
270 video_page_offt equ 4Eh ; word - offset of the active video page
271 video_cur_pos equ 50h ; byte[16] - cursor position for each page
272 video_cur_shape equ 60h ; word - cursor shape
273 video_page equ 62h ; byte - active video page
274 video_port equ 63h ; word - I/O port for the display adapter
275 video_mode_reg equ 65h ; byte - video adapter mode register
276 video_palet_reg equ 66h ; byte - color palette
277 last_irq equ 6Bh ; byte - Last spurious IRQ number
278 ticks_lo equ 6Ch ; word - timer ticks - low word
279 ticks_hi equ 6Eh ; word - timer ticks - high word
280 new_day equ 70h ; byte - 1 = new day flag
281 break_flag equ 71h ; byte - bit 7 = 1 if Ctrl-Break was pressed
282 warm_boot equ 72h ; word - Warm boot if equals 1234h
283 printer_timeout equ 78h ; byte[3] - parallel port timeout values
284 serial_timeout equ 7Ch ; byte[4] - serial port timeout values
285 kbd_buffer_start equ 80h ; word - keyboard buffer start offset
286 kbd_buffer_end equ 82h ; word - keyboard buffer end offset
287 video_rows equ 84h ; byte - number of text rows (EGA+)
288 fdc_last_rate equ 8Bh ; byte - last data rate / step rate
289 fdc_info equ 8Fh ; byte - floppy dist drive information
290 fdc_media_state equ 90h ; byte[4] - drive media state (drives 0 - 3)
291 fdc_cylinder equ 94h ; byte[2] - current cylinder (drives 0 - 1)
292 kbd_flags_3 equ 96h ; byte - keyboard status flags 3
293 kbd_flags_4 equ 97h ; byte - keyboard status flags 4
294 prt_scrn_flags equ 100h ; byte - print screen flags
295 prt_scrn_ready equ 00h ; print screen is not in progress
296 prt_scrn_run equ 01h ; print screen is in progress
297 prt_scrn_fail equ 0FFh ; last print screen attempt has failed
298
299 ;=========================================================================
300 ; Extended BIOS data area variables
301 ;-------------------------------------------------------------------------
302 ebda_size equ 0h
303 mouse_driver equ 22h ; 4 bytes - pointer to mouse driver
304 mouse_flags_1 equ 26h
305 mouse_flags_2 equ 27h
306 mouse_data equ 28h ; 8 bytes - mouse data buffer
307
308 org START ; Use only upper 32 KiB of ROM
309
310 ;=========================================================================
311 ; Includes
312 ;-------------------------------------------------------------------------
313 %include "messages.inc" ; POST messages
314 <1> ;=========================================================================
315 <1> ; messages.inc - Messages printed by BIOS POST (Power On Self Test)
316 <1> ;-------------------------------------------------------------------------
317 <1> ;
318 <1> ; Compiles with NASM 2.07, might work with other versions
319 <1> ;
320 <1> ; Copyright (C) 2011 - 2014 Sergey Kiselev.
321 <1> ; Provided for hobbyist use on the Xi 8088 board.
322 <1> ;
323 <1> ; This program is free software: you can redistribute it and/or modify
324 <1> ; it under the terms of the GNU General Public License as published by
325 <1> ; the Free Software Foundation, either version 3 of the License, or
326 <1> ; (at your option) any later version.
327 <1> ;
328 <1> ; This program is distributed in the hope that it will be useful,
329 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of
330 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
331 <1> ; GNU General Public License for more details.
332 <1> ;
333 <1> ; You should have received a copy of the GNU General Public License
334 <1> ; along with this program. If not, see <http://www.gnu.org/licenses/>.
335 <1> ;
336 <1> ;=========================================================================
337 <1>
338 00000000 0D0A <1> msg_copyright db 0Dh, 0Ah
339 00000002 586920383038382042- <1> db "Xi 8088 BIOS, Version "
340 0000000B 494F532C2056657273- <1>
341 00000014 696F6E20 <1>
342 00000018 302E392E30 <1> db VERSION
343 0000001D 2E20 <1> db ". "
344 0000001F 436F70797269676874- <1> db "Copyright (C) 2010 - 2014 Sergey Kiselev", 0Dh, 0Ah
345 00000028 202843292032303130- <1>
346 00000031 202D20323031342053- <1>
347 0000003A 6572676579204B6973- <1>
348 00000043 656C65760D0A <1>
349 00000049 446973747269627574- <1> db "Distributed under the terms of "
350 00000052 656420756E64657220- <1>
351 0000005B 746865207465726D73- <1>
352 00000064 206F6620 <1>
353 00000068 74686520474E552047- <1> db "the GNU General Public License", 0Dh, 0Ah
354 00000071 656E6572616C205075- <1>
355 0000007A 626C6963204C696365- <1>
356 00000083 6E73650D0A <1>
357 00000088 0D0A00 <1> msg_crlf db 0Dh, 0Ah, 00h
358 0000008B 6E6F6E6500 <1> msg_none db 'none', 00h
359 00000090 3A2000 <1> msg_colon db ': ', 00h
360 00000093 3B2000 <1> msg_semicolon db '; ', 00h
361 00000096 4D61696E2050726F63- <1> msg_cpu db 'Main Processor: ', 00h
362 0000009F 6573736F723A202020- <1>
363 000000A8 202020202020202020- <1>
364 000000B1 2000 <1>
365 000000B3 4D617468656D617469- <1> msg_fpu db 'Mathematics Co-processor: ', 00h
366 000000BC 637320436F2D70726F- <1>
367 000000C5 636573736F723A2020- <1>
368 000000CE 2000 <1>
369 000000D0 496E74656C20383038- <1> msg_cpu_8088_78 db "Intel 8088 '78", 0Dh, 0Ah
370 000000D9 38202737380D0A <1>
371 000000E0 5741524E494E473A20- <1> db 'WARNING: This CPU does not disable interrupts '
372 000000E9 546869732043505520- <1>
373 000000F2 646F6573206E6F7420- <1>
374 000000FB 64697361626C652069- <1>
375 00000104 6E7465727275707473- <1>
376 0000010D 20 <1>
377 0000010E 6166746572206C6F61- <1> db 'after loading segment registers!', 0Dh, 0Ah, 00h
378 00000117 64696E67207365676D- <1>
379 00000120 656E74207265676973- <1>
380 00000129 74657273210D0A00 <1>
381 00000131 496E74656C20383038- <1> msg_cpu_8088_81 db "Intel 8088 '81 or later, "
382 0000013A 3820273831206F7220- <1>
383 00000143 6C617465722C20 <1>
384 0000014A 6F72204F4B492D6465- <1> db 'or OKI-designed 80C88', 0Dh, 0Ah, 00h
385 00000153 7369676E6564203830- <1>
386 0000015C 4338380D0A00 <1>
387 00000162 4861727269732D6465- <1> msg_cpu_harris db 'Harris-designed 80C88', 0Dh, 0Ah, 00h
388 0000016B 7369676E6564203830- <1>
389 00000174 4338380D0A00 <1>
390 0000017A 4E4543205632300D0A- <1> msg_cpu_nec_v20 db 'NEC V20', 0Dh, 0Ah, 00h
391 00000183 00 <1>
392 00000184 496E74656C20383038- <1> msg_fpu_present db 'Intel 8087', 0Dh, 0Ah, 00h
393 0000018D 370D0A00 <1>
394 00000191 446973706C61792041- <1> msg_disp db 'Display Adapter Type: ', 00h
395 0000019A 646170746572205479- <1>
396 000001A3 70653A202020202020- <1>
397 000001AC 2000 <1>
398 000001AE 4547412F5647412028- <1> msg_disp_ega db 'EGA/VGA (Video BIOS Present)', 0Dh, 0Ah, 00h
399 000001B7 566964656F2042494F- <1>
400 000001C0 532050726573656E74- <1>
401 000001C9 290D0A00 <1>
402 000001CD 4347410D0A00 <1> msg_disp_cga db 'CGA', 0Dh, 0Ah, 00h
403 000001D3 4D4441206F72204865- <1> msg_disp_mda db 'MDA or Hercules', 0Dh, 0Ah, 00h
404 000001DC 7263756C65730D0A00 <1>
405 000001E5 52544320285265616C- <1> msg_rtc db 'RTC (Real Time Clock) time: ', 00h
406 000001EE 2054696D6520436C6F- <1>
407 000001F7 636B292074696D653A- <1>
408 00000200 2000 <1>
409 00000202 466C6F707079206469- <1> msg_floppy db 'Floppy disk drives: Drive 0: ', 00h
410 0000020B 736B20647269766573- <1>
411 00000214 3A2020202020202020- <1>
412 0000021D 20447269766520303A- <1>
413 00000226 2000 <1>
414 00000228 3B2044726976652031- <1> msg_floppy_2 db '; Drive 1: ', 00h
415 00000231 3A2000 <1>
416 00000234 333630204B422C2035- <1> msg_floppy_360 db '360 KB, 5.25"', 00h
417 0000023D 2E32352200 <1>
418 00000242 312E32204D422C2035- <1> msg_floppy_1200 db '1.2 MB, 5.25"', 00h
419 0000024B 2E32352200 <1>
420 00000250 373230204B422C2033- <1> msg_floppy_720 db '720 KB, 3.5"', 00h
421 00000259 2E352200 <1>
422 0000025D 312E3434204D422C20- <1> msg_floppy_1440 db '1.44 MB, 3.5"', 00h
423 00000266 332E352200 <1>
424 0000026B 322E3838204D422C20- <1> msg_floppy_2880 db '2.88 MB, 3.5"', 00h
425 00000274 332E352200 <1>
426 00000279 50532F322041757820- <1> msg_mouse db 'PS/2 Aux Device (Mouse): ', 00h
427 00000282 44657669636520284D- <1>
428 0000028B 6F757365293A202020- <1>
429 00000294 2000 <1>
430 00000296 50726573656E740D0A- <1> msg_present db 'Present', 0Dh, 0Ah, 00h
431 0000029F 00 <1>
432 000002A0 416273656E740D0A00 <1> msg_absent db 'Absent', 0Dh, 0Ah, 00h
433 000002A9 53657269616C20506F- <1> msg_serial db 'Serial Ports: ', 00h
434 000002B2 7274733A2020202020- <1>
435 000002BB 202020202020202020- <1>
436 000002C4 2000 <1>
437 000002C6 434F4D00 <1> msg_serial_com db 'COM', 00h
438 000002CA 506172616C6C656C20- <1> msg_parallel db 'Parallel Ports: ', 00h
439 000002D3 506F7274733A202020- <1>
440 000002DC 202020202020202020- <1>
441 000002E5 2000 <1>
442 000002E7 4C505400 <1> msg_parallel_lpt db 'LPT', 00h
443 000002EB 54657374696E672052- <1> msg_ram_testing db 'Testing RAM (ESC to skip): ', 00h
444 000002F4 414D20284553432074- <1>
445 000002FD 6F20736B6970293A20- <1>
446 00000306 2000 <1>
447 00000308 0D0A4552524F523A20- <1> msg_ram_error db 0Dh, 0Ah, 'ERROR: Faulty memory detected at ', 00h
448 00000311 4661756C7479206D65- <1>
449 0000031A 6D6F72792064657465- <1>
450 00000323 637465642061742000 <1>
451 0000032C 0D546F74616C20436F- <1> msg_ram_total db 0Dh, 'Total Conventional RAM: ', 00h
452 00000335 6E76656E74696F6E61- <1>
453 0000033E 6C2052414D3A202020- <1>
454 00000347 202000 <1>
455 0000034A 526573657276656420- <1> msg_ebda db 'Reserved for EBDA: ', 00h
456 00000353 666F7220454244413A- <1>
457 0000035C 202020202020202020- <1>
458 00000365 2000 <1>
459 00000367 417661696C61626C65- <1> msg_ram_avail db 'Available Conventional RAM: ', 00h
460 00000370 20436F6E76656E7469- <1>
461 00000379 6F6E616C2052414D3A- <1>
462 00000382 2000 <1>
463 00000384 204B69420D0A00 <1> msg_kib db ' KiB', 0Dh, 0Ah, 00h
464 0000038B 426F6F74206661696C- <1> msg_boot_failed db 'Boot failed, press any key to try again...', 0Dh, 0Ah, 0
465 00000394 65642C207072657373- <1>
466 0000039D 20616E79206B657920- <1>
467 000003A6 746F20747279206167- <1>
468 000003AF 61696E2E2E2E0D0A00 <1>
469 000003B8 4E6F20524F4D204241- <1> msg_no_basic db 'No ROM BASIC', 0Dh, 0Ah, 0
470 000003C1 5349430D0A00 <1>
471 000003C7 466F756E642042494F- <1> msg_rom_found db 'Found BIOS extension ROM at ', 0
472 000003D0 5320657874656E7369- <1>
473 000003D9 6F6E20524F4D206174- <1>
474 000003E2 2000 <1>
475 000003E4 302C20696E69746961- <1> msg_rom_init db '0, initializing...', 0Dh, 0Ah, 0
476 000003ED 6C697A696E672E2E2E- <1>
477 000003F6 0D0A00 <1>
478 000003F9 426F6F74696E67204F- <1> msg_boot db 'Booting OS...', 0Dh, 0Ah, 0
479 00000402 532E2E2E0D0A00 <1>
480 00000409 4552524F523A205254- <1> msg_rtc_bad db 'ERROR: RTC battery is bad', 0Dh, 0Ah, 00h
481 00000412 432062617474657279- <1>
482 0000041B 206973206261640D0A- <1>
483 00000424 00 <1>
484 00000425 4552524F523A204E56- <1> msg_rtc_sum db 'ERROR: NVRAM checksum is invalid, '
485 0000042E 52414D20636865636B- <1>
486 00000437 73756D20697320696E- <1>
487 00000440 76616C69642C20 <1>
488 00000447 6C6F6164696E672064- <1> db 'loading default values to NVRAM', 0Dh, 0Ah, 00h
489 00000450 656661756C74207661- <1>
490 00000459 6C75657320746F204E- <1>
491 00000462 5652414D0D0A00 <1>
492 00000469 507265737320463120- <1> msg_setup db 'Press F1 to run NVRAM setup...',0Dh, 0Ah, 0Dh, 0Ah, 00h
493 00000472 746F2072756E204E56- <1>
494 0000047B 52414D207365747570- <1>
495 00000484 2E2E2E0D0A0D0A00 <1>
496 0000048C 0D0A57656C636F6D65- <1> msg_set_welcome db 0Dh, 0Ah, 'Welcome to the NVRAM setup utility', 00h
497 00000495 20746F20746865204E- <1>
498 0000049E 5652414D2073657475- <1>
499 000004A7 70207574696C697479- <1>
500 000004B0 00 <1>
501 000004B1 0D0A <1> msg_set_help db 0Dh, 0Ah
502 000004B3 4E5652414D20736574- <1> db 'NVRAM setup commands:', 0Dh, 0Ah
503 000004BC 757020636F6D6D616E- <1>
504 000004C5 64733A0D0A <1>
505 000004CA 74202D205365742074- <1> db 't - Set time', 0Dh, 0Ah
506 000004D3 696D650D0A <1>
507 000004D8 64202D205365742064- <1> db 'd - Set date', 0Dh, 0Ah
508 000004E1 6174650D0A <1>
509 000004E6 66202D204368616E67- <1> db 'f - Change first floppy drive type', 0Dh, 0Ah
510 000004EF 652066697273742066- <1>
511 000004F8 6C6F70707920647269- <1>
512 00000501 766520747970650D0A <1>
513 0000050A 67202D204368616E67- <1> db 'g - Change second floppy drive type', 0Dh, 0Ah
514 00000513 65207365636F6E6420- <1>
515 0000051C 666C6F707079206472- <1>
516 00000525 69766520747970650D- <1>
517 0000052E 0A <1>
518 0000052F 70202D205072696E74- <1> db 'p - Print current settings', 0Dh, 0Ah
519 00000538 2063757272656E7420- <1>
520 00000541 73657474696E67730D- <1>
521 0000054A 0A <1>
522 0000054B 77202D205361766520- <1> db 'w - Save changes and exit', 0Dh, 0Ah
523 00000554 6368616E6765732061- <1>
524 0000055D 6E6420657869740D0A <1>
525 00000566 71202D204578697420- <1> db 'q - Exit without saving changes', 0Dh, 0Ah
526 0000056F 776974686F75742073- <1>
527 00000578 6176696E6720636861- <1>
528 00000581 6E6765730D0A <1>
529 00000587 68202D2053686F7720- <1> db 'h - Show this help', 0Dh, 0Ah, 00h
530 00000590 746869732068656C70- <1>
531 00000599 0D0A00 <1>
532 0000059C 0D0A456E7465722063- <1> msg_set_prompt db 0Dh, 0Ah, 'Enter command (h for help): ', 00h
533 000005A5 6F6D6D616E64202868- <1>
534 000005AE 20666F722068656C70- <1>
535 000005B7 293A2000 <1>
536 000005BB 456E7465722074696D- <1> msg_set_time db 'Enter time (hh:mm:ss): ', 00h
537 000005C4 65202868683A6D6D3A- <1>
538 000005CD 7373293A2000 <1>
539 000005D3 456E74657220646174- <1> msg_set_date db 'Enter date (YYYY-MM-DD): ', 00h
540 000005DC 652028595959592D4D- <1>
541 000005E5 4D2D4444293A2000 <1>
542 000005ED 4552524F523A20496E- <1> msg_time_inval db 'ERROR: Invalid time.', 0Dh, 0Ah, 00h
543 000005F6 76616C69642074696D- <1>
544 000005FF 652E0D0A00 <1>
545 00000604 4552524F523A20496E- <1> msg_date_inval db 'ERROR: Invalid date.', 0Dh, 0Ah, 00h
546 0000060D 76616C696420646174- <1>
547 00000616 652E0D0A00 <1>
548 0000061B 0D0A <1> msg_set_fd_help db 0Dh, 0Ah
549 0000061D 466C6F707079206472- <1> db 'Floppy drive types:', 0Dh, 0Ah
550 00000626 697665207479706573- <1>
551 0000062F 3A0D0A <1>
552 00000632 30202D204E6F742069- <1> db '0 - Not installed 3 - 720 KB, 3.5"', 0Dh, 0Ah
553 0000063B 6E7374616C6C656420- <1>
554 00000644 202033202D20373230- <1>
555 0000064D 204B422C20332E3522- <1>
556 00000656 0D0A <1>
557 00000658 31202D20333630204B- <1> db '1 - 360 KB, 5.25" 4 - 1.44 MB, 3.5"', 0Dh, 0Ah
558 00000661 422C20352E32352220- <1>
559 0000066A 202034202D20312E34- <1>
560 00000673 34204D422C20332E35- <1>
561 0000067C 220D0A <1>
562 0000067F 32202D20312E32204D- <1> db '2 - 1.2 MB, 5.25" 6 - 2.88 MB, 3.5"', 0Dh, 0Ah
563 00000688 422C20352E32352220- <1>
564 00000691 202036202D20322E38- <1>
565 0000069A 38204D422C20332E35- <1>
566 000006A3 220D0A <1>
567 000006A6 536574757020636F6D- <1> db 'Setup commands:', 0Dh, 0Ah
568 000006AF 6D616E64733A0D0A <1>
569 000006B7 72202D205265747572- <1> db 'r - Return to the main menu', 0Dh, 0Ah
570 000006C0 6E20746F2074686520- <1>
571 000006C9 6D61696E206D656E75- <1>
572 000006D2 0D0A <1>
573 000006D4 68202D2053686F7720- <1> db 'h - Show this help', 0Dh, 0Ah, 00h
574 000006DD 746869732068656C70- <1>
575 000006E6 0D0A00 <1>
576 000006E9 0D0A456E7465722066- <1> msg_set_fd_prmt db 0Dh, 0Ah, 'Enter floppy drive type (h for help): '
577 000006F2 6C6F70707920647269- <1>
578 000006FB 766520747970652028- <1>
579 00000704 6820666F722068656C- <1>
580 0000070D 70293A20 <1>
581 00000711 00 <1> db 00h
582 00000712 [8B00] <1> tbl_floppy dw msg_none
583 00000714 [3402] <1> dw msg_floppy_360
584 00000716 [4202] <1> dw msg_floppy_1200
585 00000718 [5002] <1> dw msg_floppy_720
586 0000071A [5D02] <1> dw msg_floppy_1440
587 0000071C [8B00] <1> dw msg_none
588 0000071E [6B02] <1> dw msg_floppy_2880
589 00000720 [8B00] <1> dw msg_none
590 %include "fnt80-FF.inc" ; font for graphics modes
591 <1> ;=========================================================================
592 <1> ; fnt80-FF.inc - Font for graphics modes (Cyrillic font)
593 <1> ; Characters from 80h to 0FFh
594 <1> ;-------------------------------------------------------------------------
595 <1> ;
596 <1> ; Compiles with NASM 2.07, might work with other versions
597 <1> ;
598 <1> ; This font is borrowed from kbd package (alt-8x8)
599 <1> ;
600 <1> ; This program is free software: you can redistribute it and/or modify
601 <1> ; it under the terms of the GNU General Public License as published by
602 <1> ; the Free Software Foundation, either version 3 of the License, or
603 <1> ; (at your option) any later version.
604 <1> ;
605 <1> ; This program is distributed in the hope that it will be useful,
606 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of
607 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
608 <1> ; GNU General Public License for more details.
609 <1> ;
610 <1> ; You should have received a copy of the GNU General Public License
611 <1> ; along with this program. If not, see <http://www.gnu.org/licenses/>.
612 <1> ;
613 <1> ;=========================================================================
614 <1> int_1F:
615 00000722 1E3666667E666600 <1> db 1Eh, 36h, 66h, 66h, 7Eh, 66h, 66h, 00h
616 0000072A 7C60607C66667C00 <1> db 7Ch, 60h, 60h, 7Ch, 66h, 66h, 7Ch, 00h
617 00000732 7C66667C66667C00 <1> db 7Ch, 66h, 66h, 7Ch, 66h, 66h, 7Ch, 00h
618 0000073A 7E60606060606000 <1> db 7Eh, 60h, 60h, 60h, 60h, 60h, 60h, 00h
619 00000742 386C6C6C6C6CFEC6 <1> db 38h, 6Ch, 6Ch, 6Ch, 6Ch, 6Ch, 0FEh, 0C6h
620 0000074A 7E60607C60607E00 <1> db 7Eh, 60h, 60h, 7Ch, 60h, 60h, 7Eh, 00h
621 00000752 DBDB7E3C7EDBDB00 <1> db 0DBh, 0DBh, 7Eh, 3Ch, 7Eh, 0DBh, 0DBh, 00h
622 0000075A 3C66061C06663C00 <1> db 3Ch, 66h, 06h, 1Ch, 06h, 66h, 3Ch, 00h
623 00000762 66666E7E76666600 <1> db 66h, 66h, 6Eh, 7Eh, 76h, 66h, 66h, 00h
624 0000076A 3C666E7E76666600 <1> db 3Ch, 66h, 6Eh, 7Eh, 76h, 66h, 66h, 00h
625 00000772 666C7870786C6600 <1> db 66h, 6Ch, 78h, 70h, 78h, 6Ch, 66h, 00h
626 0000077A 1E36666666666600 <1> db 1Eh, 36h, 66h, 66h, 66h, 66h, 66h, 00h
627 00000782 C6EEFEFED6C6C600 <1> db 0C6h, 0EEh, 0FEh, 0FEh, 0D6h, 0C6h, 0C6h, 00h
628 0000078A 6666667E66666600 <1> db 66h, 66h, 66h, 7Eh, 66h, 66h, 66h, 00h
629 00000792 3C66666666663C00 <1> db 3Ch, 66h, 66h, 66h, 66h, 66h, 3Ch, 00h
630 0000079A 7E66666666666600 <1> db 7Eh, 66h, 66h, 66h, 66h, 66h, 66h, 00h
631 000007A2 7C6666667C606000 <1> db 7Ch, 66h, 66h, 66h, 7Ch, 60h, 60h, 00h
632 000007AA 3C66606060663C00 <1> db 3Ch, 66h, 60h, 60h, 60h, 66h, 3Ch, 00h
633 000007B2 7E18181818181800 <1> db 7Eh, 18h, 18h, 18h, 18h, 18h, 18h, 00h
634 000007BA 6666663E06663C00 <1> db 66h, 66h, 66h, 3Eh, 06h, 66h, 3Ch, 00h
635 000007C2 7EDBDBDB7E181800 <1> db 7Eh, 0DBh, 0DBh, 0DBh, 7Eh, 18h, 18h, 00h
636 000007CA 66663C183C666600 <1> db 66h, 66h, 3Ch, 18h, 3Ch, 66h, 66h, 00h
637 000007D2 6666666666667F03 <1> db 66h, 66h, 66h, 66h, 66h, 66h, 7Fh, 03h
638 000007DA 6666663E06060600 <1> db 66h, 66h, 66h, 3Eh, 06h, 06h, 06h, 00h
639 000007E2 DBDBDBDBDBDBFF00 <1> db 0DBh, 0DBh, 0DBh, 0DBh, 0DBh, 0DBh, 0FFh, 00h
640 000007EA DBDBDBDBDBDBFF03 <1> db 0DBh, 0DBh, 0DBh, 0DBh, 0DBh, 0DBh, 0FFh, 03h
641 000007F2 E060607C66667C00 <1> db 0E0h, 60h, 60h, 7Ch, 66h, 66h, 7Ch, 00h
642 000007FA C6C6C6F6DEDEF600 <1> db 0C6h, 0C6h, 0C6h, 0F6h, 0DEh, 0DEh, 0F6h, 00h
643 00000802 6060607C66667C00 <1> db 60h, 60h, 60h, 7Ch, 66h, 66h, 7Ch, 00h
644 0000080A 788C063E068C7800 <1> db 78h, 8Ch, 06h, 3Eh, 06h, 8Ch, 78h, 00h
645 00000812 CEDBDBFBDBDBCE00 <1> db 0CEh, 0DBh, 0DBh, 0FBh, 0DBh, 0DBh, 0CEh, 00h
646 0000081A 3E6666663E366600 <1> db 3Eh, 66h, 66h, 66h, 3Eh, 36h, 66h, 00h
647 00000822 0000780C7CCC7600 <1> db 00h, 00h, 78h, 0Ch, 7Ch, 0CCh, 76h, 00h
648 0000082A 003C603C66663C00 <1> db 00h, 3Ch, 60h, 3Ch, 66h, 66h, 3Ch, 00h
649 00000832 00007C667C667C00 <1> db 00h, 00h, 7Ch, 66h, 7Ch, 66h, 7Ch, 00h
650 0000083A 00007E6060606000 <1> db 00h, 00h, 7Eh, 60h, 60h, 60h, 60h, 00h
651 00000842 00003C6C6C6CFEC6 <1> db 00h, 00h, 3Ch, 6Ch, 6Ch, 6Ch, 0FEh, 0C6h
652 0000084A 00003C667E603C00 <1> db 00h, 00h, 3Ch, 66h, 7Eh, 60h, 3Ch, 00h
653 00000852 0000DB7E3C7EDB00 <1> db 00h, 00h, 0DBh, 7Eh, 3Ch, 7Eh, 0DBh, 00h
654 0000085A 00003C660C663C00 <1> db 00h, 00h, 3Ch, 66h, 0Ch, 66h, 3Ch, 00h
655 00000862 0000666E7E766600 <1> db 00h, 00h, 66h, 6Eh, 7Eh, 76h, 66h, 00h
656 0000086A 0018666E7E766600 <1> db 00h, 18h, 66h, 6Eh, 7Eh, 76h, 66h, 00h
657 00000872 0000666C786C6600 <1> db 00h, 00h, 66h, 6Ch, 78h, 6Ch, 66h, 00h
658 0000087A 00001E3666666600 <1> db 00h, 00h, 1Eh, 36h, 66h, 66h, 66h, 00h
659 00000882 0000C6FEFED6C600 <1> db 00h, 00h, 0C6h, 0FEh, 0FEh, 0D6h, 0C6h, 00h
660 0000088A 000066667E666600 <1> db 00h, 00h, 66h, 66h, 7Eh, 66h, 66h, 00h
661 00000892 00003C6666663C00 <1> db 00h, 00h, 3Ch, 66h, 66h, 66h, 3Ch, 00h
662 0000089A 00007E6666666600 <1> db 00h, 00h, 7Eh, 66h, 66h, 66h, 66h, 00h
663 000008A2 1144114411441144 <1> db 11h, 44h, 11h, 44h, 11h, 44h, 11h, 44h
664 000008AA 55AA55AA55AA55AA <1> db 55h, 0AAh, 55h, 0AAh, 55h, 0AAh, 55h, 0AAh
665 000008B2 DD77DD77DD77DD77 <1> db 0DDh, 77h, 0DDh, 77h, 0DDh, 77h, 0DDh, 77h
666 000008BA 1818181818181818 <1> db 18h, 18h, 18h, 18h, 18h, 18h, 18h, 18h
667 000008C2 181818F818181818 <1> db 18h, 18h, 18h, 0F8h, 18h, 18h, 18h, 18h
668 000008CA 18F818F818181818 <1> db 18h, 0F8h, 18h, 0F8h, 18h, 18h, 18h, 18h
669 000008D2 363636F636363636 <1> db 36h, 36h, 36h, 0F6h, 36h, 36h, 36h, 36h
670 000008DA 000000FE36363636 <1> db 00h, 00h, 00h, 0FEh, 36h, 36h, 36h, 36h
671 000008E2 00F818F818181818 <1> db 00h, 0F8h, 18h, 0F8h, 18h, 18h, 18h, 18h
672 000008EA 36F606F636363636 <1> db 36h, 0F6h, 06h, 0F6h, 36h, 36h, 36h, 36h
673 000008F2 3636363636363636 <1> db 36h, 36h, 36h, 36h, 36h, 36h, 36h, 36h
674 000008FA 00FE06F636363636 <1> db 00h, 0FEh, 06h, 0F6h, 36h, 36h, 36h, 36h
675 00000902 36F606FE00000000 <1> db 36h, 0F6h, 06h, 0FEh, 00h, 00h, 00h, 00h
676 0000090A 363636FE00000000 <1> db 36h, 36h, 36h, 0FEh, 00h, 00h, 00h, 00h
677 00000912 18F818F800000000 <1> db 18h, 0F8h, 18h, 0F8h, 00h, 00h, 00h, 00h
678 0000091A 000000F818181818 <1> db 00h, 00h, 00h, 0F8h, 18h, 18h, 18h, 18h
679 00000922 1818181F00000000 <1> db 18h, 18h, 18h, 1Fh, 00h, 00h, 00h, 00h
680 0000092A 181818FF00000000 <1> db 18h, 18h, 18h, 0FFh, 00h, 00h, 00h, 00h
681 00000932 000000FF18181818 <1> db 00h, 00h, 00h, 0FFh, 18h, 18h, 18h, 18h
682 0000093A 1818181F18181818 <1> db 18h, 18h, 18h, 1Fh, 18h, 18h, 18h, 18h
683 00000942 000000FF00000000 <1> db 00h, 00h, 00h, 0FFh, 00h, 00h, 00h, 00h
684 0000094A 181818FF18181818 <1> db 18h, 18h, 18h, 0FFh, 18h, 18h, 18h, 18h
685 00000952 181F181F18181818 <1> db 18h, 1Fh, 18h, 1Fh, 18h, 18h, 18h, 18h
686 0000095A 3636363736363636 <1> db 36h, 36h, 36h, 37h, 36h, 36h, 36h, 36h
687 00000962 3637303F00000000 <1> db 36h, 37h, 30h, 3Fh, 00h, 00h, 00h, 00h
688 0000096A 003F303736363636 <1> db 00h, 3Fh, 30h, 37h, 36h, 36h, 36h, 36h
689 00000972 36F700FF00000000 <1> db 36h, 0F7h, 00h, 0FFh, 00h, 00h, 00h, 00h
690 0000097A 00FF00F736363636 <1> db 00h, 0FFh, 00h, 0F7h, 36h, 36h, 36h, 36h
691 00000982 3637303736363636 <1> db 36h, 37h, 30h, 37h, 36h, 36h, 36h, 36h
692 0000098A 00FF00FF00000000 <1> db 00h, 0FFh, 00h, 0FFh, 00h, 00h, 00h, 00h
693 00000992 36F700F736363636 <1> db 36h, 0F7h, 00h, 0F7h, 36h, 36h, 36h, 36h
694 0000099A 18FF00FF00000000 <1> db 18h, 0FFh, 00h, 0FFh, 00h, 00h, 00h, 00h
695 000009A2 363636FF00000000 <1> db 36h, 36h, 36h, 0FFh, 00h, 00h, 00h, 00h
696 000009AA 00FF00FF18181818 <1> db 00h, 0FFh, 00h, 0FFh, 18h, 18h, 18h, 18h
697 000009B2 000000FF36363636 <1> db 00h, 00h, 00h, 0FFh, 36h, 36h, 36h, 36h
698 000009BA 3636363F00000000 <1> db 36h, 36h, 36h, 3Fh, 00h, 00h, 00h, 00h
699 000009C2 181F181F00000000 <1> db 18h, 1Fh, 18h, 1Fh, 00h, 00h, 00h, 00h
700 000009CA 001F181F18181818 <1> db 00h, 1Fh, 18h, 1Fh, 18h, 18h, 18h, 18h
701 000009D2 0000003F36363636 <1> db 00h, 00h, 00h, 3Fh, 36h, 36h, 36h, 36h
702 000009DA 363636FF36363636 <1> db 36h, 36h, 36h, 0FFh, 36h, 36h, 36h, 36h
703 000009E2 18FF18FF18181818 <1> db 18h, 0FFh, 18h, 0FFh, 18h, 18h, 18h, 18h
704 000009EA 181818F800000000 <1> db 18h, 18h, 18h, 0F8h, 00h, 00h, 00h, 00h
705 000009F2 0000001F18181818 <1> db 00h, 00h, 00h, 1Fh, 18h, 18h, 18h, 18h
706 000009FA FFFFFFFFFFFFFFFF <1> db 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
707 00000A02 000000FFFFFFFFFF <1> db 00h, 00h, 00h, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
708 00000A0A F0F0F0F0F0F0F0F0 <1> db 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h, 0F0h
709 00000A12 0F0F0F0F0F0F0F0F <1> db 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh, 0Fh
710 00000A1A FFFFFF0000000000 <1> db 0FFh, 0FFh, 0FFh, 00h, 00h, 00h, 00h, 00h
711 00000A22 00007C66667C6000 <1> db 00h, 00h, 7Ch, 66h, 66h, 7Ch, 60h, 00h
712 00000A2A 00003C6660663C00 <1> db 00h, 00h, 3Ch, 66h, 60h, 66h, 3Ch, 00h
713 00000A32 00007E1818181800 <1> db 00h, 00h, 7Eh, 18h, 18h, 18h, 18h, 00h
714 00000A3A 000066663E063C00 <1> db 00h, 00h, 66h, 66h, 3Eh, 06h, 3Ch, 00h
715 00000A42 00007EDBDB7E1800 <1> db 00h, 00h, 7Eh, 0DBh, 0DBh, 7Eh, 18h, 00h
716 00000A4A 0000663C183C6600 <1> db 00h, 00h, 66h, 3Ch, 18h, 3Ch, 66h, 00h
717 00000A52 0000666666667F03 <1> db 00h, 00h, 66h, 66h, 66h, 66h, 7Fh, 03h
718 00000A5A 000066663E060600 <1> db 00h, 00h, 66h, 66h, 3Eh, 06h, 06h, 00h
719 00000A62 0000DBDBDBDBFF00 <1> db 00h, 00h, 0DBh, 0DBh, 0DBh, 0DBh, 0FFh, 00h
720 00000A6A 0000DBDBDBDBFF03 <1> db 00h, 00h, 0DBh, 0DBh, 0DBh, 0DBh, 0FFh, 03h
721 00000A72 0000E0607C667C00 <1> db 00h, 00h, 0E0h, 60h, 7Ch, 66h, 7Ch, 00h
722 00000A7A 0000C6C6F6DEF600 <1> db 00h, 00h, 0C6h, 0C6h, 0F6h, 0DEh, 0F6h, 00h
723 00000A82 000060607C667C00 <1> db 00h, 00h, 60h, 60h, 7Ch, 66h, 7Ch, 00h
724 00000A8A 00007C063E067C00 <1> db 00h, 00h, 7Ch, 06h, 3Eh, 06h, 7Ch, 00h
725 00000A92 0000CEDBFBDBCE00 <1> db 00h, 00h, 0CEh, 0DBh, 0FBh, 0DBh, 0CEh, 00h
726 00000A9A 00003E663E366600 <1> db 00h, 00h, 3Eh, 66h, 3Eh, 36h, 66h, 00h
727 00000AA2 66007E607C607E00 <1> db 66h, 00h, 7Eh, 60h, 7Ch, 60h, 7Eh, 00h
728 00000AAA 24003C667E603C00 <1> db 24h, 00h, 3Ch, 66h, 7Eh, 60h, 3Ch, 00h
729 00000AB2 0030180C060C1830 <1> db 00h, 30h, 18h, 0Ch, 06h, 0Ch, 18h, 30h
730 00000ABA 000C18306030180C <1> db 00h, 0Ch, 18h, 30h, 60h, 30h, 18h, 0Ch
731 00000AC2 0E1B1B1818181818 <1> db 0Eh, 1Bh, 1Bh, 18h, 18h, 18h, 18h, 18h
732 00000ACA 1818181818D8D870 <1> db 18h, 18h, 18h, 18h, 18h, 0D8h, 0D8h, 70h
733 00000AD2 001818007E001818 <1> db 00h, 18h, 18h, 00h, 7Eh, 00h, 18h, 18h
734 00000ADA 0076DC0076DC0000 <1> db 00h, 76h, 0DCh, 00h, 76h, 0DCh, 00h, 00h
735 00000AE2 00386C6C38000000 <1> db 00h, 38h, 6Ch, 6Ch, 38h, 00h, 00h, 00h
736 00000AEA 0000000018000000 <1> db 00h, 00h, 00h, 00h, 18h, 00h, 00h, 00h
737 00000AF2 0000003838000000 <1> db 00h, 00h, 00h, 38h, 38h, 00h, 00h, 00h
738 00000AFA 03020604CC683810 <1> db 03h, 02h, 06h, 04h, 0CCh, 68h, 38h, 10h
739 00000B02 3C4299A1A199423C <1> db 3Ch, 42h, 99h, 0A1h, 0A1h, 99h, 42h, 3Ch
740 00000B0A 3048102078000000 <1> db 30h, 48h, 10h, 20h, 78h, 00h, 00h, 00h
741 00000B12 00007C7C7C7C0000 <1> db 00h, 00h, 7Ch, 7Ch, 7Ch, 7Ch, 00h, 00h
742 00000B1A 0000000000427E00 <1> db 00h, 00h, 00h, 00h, 00h, 42h, 7Eh, 00h
743 ;%include "inttrace.inc" ; XXX
744 %include "rtc.inc" ; RTC and CMOS read / write functions
745 <1> ;=========================================================================
746 <1> ; rtc.inc - RTC/CMOS read and write functions
747 <1> ;-------------------------------------------------------------------------
748 <1> ;
749 <1> ; Compiles with NASM 2.07, might work with other versions
750 <1> ;
751 <1> ; Copyright (C) 2011 - 2014 Sergey Kiselev.
752 <1> ; Provided for hobbyist use on the Xi 8088 board.
753 <1> ;
754 <1> ; This program is free software: you can redistribute it and/or modify
755 <1> ; it under the terms of the GNU General Public License as published by
756 <1> ; the Free Software Foundation, either version 3 of the License, or
757 <1> ; (at your option) any later version.
758 <1> ;
759 <1> ; This program is distributed in the hope that it will be useful,
760 <1> ; but WITHOUT ANY WARRANTY; without even the implied warranty of
761 <1> ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
762 <1> ; GNU General Public License for more details.
763 <1> ;
764 <1> ; You should have received a copy of the GNU General Public License
765 <1> ; along with this program. If not, see <http://www.gnu.org/licenses/>.
766 <1> ;
767 <1> ;=========================================================================
768 <1>
769 <1> ;-------------------------------------------------------------------------
770 <1> ; RTC ports
771 <1> rtc_addr_reg equ 70h ; RTC address port
772 <1> rtc_data_reg equ 71h ; RTC data port
773 <1>
774 <1> ;-------------------------------------------------------------------------
775 <1> ; locations in RTC and NVRAM
776 <1> cmos_seconds equ 00h ; seconds location in RTC
777 <1> cmos_alarm_secs equ 01h ; alarm seconds location in RTC
778 <1> cmos_minutes equ 02h ; minutes location in RTC
779 <1> cmos_alarm_mins equ 03h ; alarm minutes location in RTC
780 <1> cmos_hours equ 04h ; hours locaiton in RTC
781 <1> cmos_alarm_hrs equ 05h ; alarm hours location in RTC
782 <1> cmos_day equ 06h ; day location in RTC
783 <1> cmos_date equ 07h ; date location in RTC
784 <1> cmos_month equ 08h ; month location in RTC
785 <1> cmos_year equ 09h ; year location in RTC
786 <1> cmos_floppy equ 10h ; floppy type byte
787 <1> cmos_equip equ 14h ; equipment byte
788 <1> cmos_sum_hi equ 2Eh ; checksum of bytes 10h - 20h - high byte
789 <1> cmos_sum_lo equ 2Fh ; checksum of bytes 10h - 20h - low byte
790 <1> cmos_century equ 32h ; centry location in RTC (DS12C887 only)
791 <1>
792 <1> ;-------------------------------------------------------------------------
793 <1> ; RTC control register and their bits
794 <1> cmos_control_a equ 0Ah ; RTC control A register
795 <1> cmos_uip equ 80h ; RTC update in progress bit
796 <1> cmos_control_b equ 0Bh ; RTC control B register
797 <1> cmos_dse equ 01h ; RTC daylight savings enable bit
798 <1> cmos_24hours equ 02h ; RTC 24 hours format (1 = 24 hours, 0 = 12)
799 <1> cmos_uie equ 10h ; RTC update ended interrupt enable bit
800 <1> cmos_aie equ 20h ; RTC alarm interrupt enable bit
801 <1> cmos_pie equ 40h ; RTC periodic interrupt enable bit
802 <1> cmos_set equ 80h ; RTC set bit (0 = normal operation, 1 = set)
803 <1> cmos_control_c equ 0Ch ; RTC control C register
804 <1> cmos_uf equ 20h ; RTC update ended interrupt flag
805 <1> cmos_af equ 40h ; RTC alarm interrupt flag
806 <1> cmos_pf equ 80h ; RTC periodic interrupt flag
807 <1> cmos_control_d equ 0Dh ; RTC control D register
808 <1> cmos_vrt equ 80h ; RTC vrt bit (1 = battery is OK)
809 <1>
810 <1> ;-------------------------------------------------------------------------
811 <1> ; NMI flag
812 <1> nmi_disable equ 7Fh ; disable NMI AND mask (bit 7 = 0)
813 <1> nmi_enable equ 80h ; enable NMI OR mask (bit 7 = 1)
814 <1>
815 <1> ;=========================================================================
816 <1> ; rtc_read - Read byte from RTC or CMOS memory
817 <1> ; Input:
818 <1> ; AL - address and NMI enable bit
819 <1> ; bits 6-0 - address of byte to read
820 <1> ; bit 7 - 0 = disable NMI, 1 = enable NMI
821 <1> ; Output:
822 <1> ; AL = byte from RTC
823 <1> ;-------------------------------------------------------------------------
824 <1> rtc_read:
825 00000B22 FA <1> cli
826 00000B23 E670 <1> out rtc_addr_reg,al
827 00000B25 EB00 <1> jmp $+2
828 00000B27 EB00 <1> jmp $+2
829 00000B29 E471 <1> in al,rtc_data_reg
830 00000B2B FB <1> sti
831 00000B2C C3 <1> ret
832 <1>
833 <1> ;=========================================================================
834 <1> ; rtc_write - Read byte to RTC or CMOS memory
835 <1> ; Input:
836 <1> ; AL - address and NMI enable bit
837 <1> ; bits 6-0 - address of byte to read
838 <1> ; bit 7 - 0 = disable NMI, 1 = enable NMI
839 <1> ; AH = byte to write to RTC
840 <1> ;-------------------------------------------------------------------------
841 <1> rtc_write:
842 00000B2D FA <1> cli
843 00000B2E E670 <1> out rtc_addr_reg,al
844 00000B30 EB00 <1> jmp $+2
845 00000B32 EB00 <1> jmp $+2
846 00000B34 86E0 <1> xchg ah,al
847 00000B36 E671 <1> out rtc_data_reg,al
848 00000B38 86E0 <1> xchg ah,al
849 00000B3A FB <1> sti
850 00000B3B C3 <1> ret
851 <1>
852 <1> ;=========================================================================
853 <1> ; rtc_init - Initialize RTC
854 <1> ; Notes:
855 <1> ; - makes sure RTC battery is OK, resets time if not
856 <1> ; - disables RTC interrupts
857 <1> ; - validates NVRAM checksum, loads default values if invalid
858 <1> ;-------------------------------------------------------------------------
859 <1> rtc_init:
860 00000B3C 50 <1> push ax
861 00000B3D 53 <1> push bx
862 00000B3E 51 <1> push cx
863 00000B3F 52 <1> push dx
864 00000B40 56 <1> push si
865 00000B41 57 <1> push di
866 00000B42 B00A <1> mov al,cmos_control_a ; select control A register
867 00000B44 B426 <1> mov ah,26h ; turn on oscillator and time keeping
868 <1> ; set SQW frequency to 1.024 KHz
869 00000B46 E8E4FF <1> call rtc_write ; write control register A
870 <1>
871 00000B49 B00B <1> mov al,cmos_control_b
872 00000B4B B402 <1> mov ah,cmos_24hours ; 24 hours, BCD format, DSE disabled
873 <1> ; interrupts disabled
874 00000B4D E8DDFF <1> call rtc_write ; write control register B
875 <1>
876 00000B50 B00C <1> mov al,cmos_control_c
877 00000B52 E8CDFF <1> call rtc_read ; read control register C - reset
878 <1> ; interrupt flags
879 <1>
880 00000B55 B00D <1> mov al,cmos_control_d
881 00000B57 E8C8FF <1> call rtc_read ; read control register D
882 00000B5A A880 <1> test al,cmos_vrt
883 00000B5C 7518 <1> jnz .1 ; RTC battery is OK
884 00000B5E BE[0904] <1> mov si,msg_rtc_bad
885 00000B61 E8701A <1> call print
886 <1> ; RTC is bad, set initial time
887 00000B64 B403 <1> mov ah,03h ; int 1Ah, function 03h - set RTC time
888 00000B66 31C9 <1> xor cx,cx
889 00000B68 31D2 <1> xor dx,dx
890 00000B6A CD1A <1> int 1Ah
891 00000B6C B405 <1> mov ah,05h ; int 1Ah, function 05h - set RTC date
892 00000B6E B91020 <1> mov cx,2010h ; year 2010
893 00000B71 BA0101 <1> mov dx,0101h ; January 1st
894 00000B74 CD1A <1> int 1Ah
895 <1>
896 <1> .1:
897 <1> ; set timer variables to RTC time
898 00000B76 B402 <1> mov ah,02h ; int 1Ah, function 02h - get RTC time
899 00000B78 CD1A <1> int 1Ah
900 <1>
901 <1> ; convert time to ticks * 2^11
902 <1>
903 <1> ; ticks = seconds * 37287
904 00000B7A 88F0 <1> mov al,dh
905 00000B7C E8AE00 <1> call bcd_to_binary ; convert seconds to binary
906 <1>
907 00000B7F BAA791 <1> mov dx,37287
908 00000B82 F7E2 <1> mul dx ; DX:AX = seconds * 37287
909 <1>
910 00000B84 89C6 <1> mov si,ax
911 00000B86 89D7 <1> mov di,dx
912 <1>
913 <1> ; ticks += minutes * 2237216 = minutes * 8992 + minutes * 34 * 2^16
914 00000B88 88C8 <1> mov al,cl
915 00000B8A E8A000 <1> call bcd_to_binary ; convert minutes to binary
916 <1>
917 00000B8D 89C3 <1> mov bx,ax
918 00000B8F BA2023 <1> mov dx,8992
919 00000B92 F7E2 <1> mul dx ; DX:AX = minutes * 8992
920 <1>
921 00000B94 01C6 <1> add si,ax
922 00000B96 11D7 <1> adc di,dx
923 <1>
924 00000B98 89D8 <1> mov ax,bx
925 00000B9A BA2200 <1> mov dx,34
926 00000B9D F7E2 <1> mul dx
927 <1>
928 00000B9F 01C7 <1> add di,ax
929 <1>
930 <1> ; ticks += hours * 134232938 = hours * 15210 + hours * 2048 * 2^16
931 00000BA1 88E8 <1> mov al,ch
932 00000BA3 E88700 <1> call bcd_to_binary ; convert hours to binary
933 <1>
934 00000BA6 89C3 <1> mov bx,ax
935 00000BA8 BA6A3B <1> mov dx,15210
936 00000BAB F7E2 <1> mul dx ; DX:AX = hours * 15210
937 <1>
938 00000BAD 01C6 <1> add si,ax
939 00000BAF 11D7 <1> adc di,dx
940 <1>
941 00000BB1 89D8 <1> mov ax,bx
942 00000BB3 BA0008 <1> mov dx,2048
943 00000BB6 F7E2 <1> mul dx ; AX = hours * 2048
944 <1>
945 00000BB8 01C7 <1> add di,ax
946 <1>
947 <1> ; CX:DX = DI:SI / 2048
948 00000BBA B10B <1> mov cl,11
949 00000BBC D3EE <1> shr si,cl
950 00000BBE 89FA <1> mov dx,di
951 00000BC0 B105 <1> mov cl,5
952 00000BC2 D3E2 <1> shl dx,cl
953 00000BC4 09F2 <1> or dx,si
954 <1>
955 00000BC6 B10B <1> mov cl,11
956 00000BC8 D3EF <1> shr di,cl
957 00000BCA 89F9 <1> mov cx,di
958 <1>
959 <1> ; CX = high word of tick count
960 <1> ; DX = low word of tick count
961 <1>
962 00000BCC B401 <1> mov ah,01h ; int 1Ah, function 01h - set time
963 00000BCE CD1A <1> int 1Ah
964 <1>
965 <1>
966 <1> ; compare NVRAM checksum with stored value
967 <1>
968 00000BD0 E86C00 <1> call rtc_checksum
969 <1>
970 00000BD3 B02E <1> mov al,cmos_sum_hi
971 00000BD5 E84AFF <1> call rtc_read
972 00000BD8 88C4 <1> mov ah,al
973 00000BDA B02F <1> mov al,cmos_sum_lo
974 00000BDC E843FF <1> call rtc_read
975 00000BDF 39C3 <1> cmp bx,ax
976 00000BE1 742F <1> je .update_equipment
977 <1>
978 00000BE3 BE[2504] <1> mov si,msg_rtc_sum
979 00000BE6 E8EB19 <1> call print
980 <1>
981 <1> ; clear NVRAM
982 <1>
983 00000BE9 B81000 <1> mov ax,0010h ; start from 10h, load 00h
984 <1>
985 <1> .nvram_clear_loop:
986 00000BEC E83EFF <1> call rtc_write
987 00000BEF FEC0 <1> inc al
988 00000BF1 3C20 <1> cmp al,20h ; last address is 20h
989 00000BF3 76F7 <1> jbe .nvram_clear_loop
990 <1>
991 00000BF5 B81040 <1> mov ax,4010h ; one 1.44M floppy disk
992 00000BF8 E832FF <1> call rtc_write
993 <1>
994 00000BFB B81421 <1> mov ax,2114h ; color 80x25, one floppy disk
995 00000BFE E82CFF <1> call rtc_write
996 <1>
997 <1> ; update checksum
998 <1>
999 00000C01 E83B00 <1> call rtc_checksum
1000 <1>