📄 nucloada.lst
字号:
730 <1> %else
731 00000398 66B901000000 <1> mov ecx,1
732 <1> %endif
733 <1>
734 <1> %%spin:
735 0000039E 6649 <1> dec ecx
736 000003A0 75FC <1> jnz %%spin
737 <1>
738 000003A2 6607 <1> o32 pop es
739 000003A4 6661 <1> popad
740 <1> %endif
741
742 ; Use gs register for wraparound segment
743 000003A6 B8FFFF mov ax,0xffff
744 000003A9 8EE8 mov gs,ax
745
746 ;
747 ; See if A20 is already enabled
748 ;
749
750 000003AB 66E882030000 call dword .test_wraparound
751 000003B1 747C jz .null_A20
752
753 ; At this point, I know the A20 line is disabled
754
755 ;
756 ; The safest method is to use the BIOS, so try to use that first
757 ;
758
759 000003B3 66E8BBFEFFFF call dword _a20_func_ena_bios
760 000003B9 0F83D600 jnc .bios_A20
761 .bios_A20_failed:
762
763 ;
764 ; Try to use the keyboard controller
765 ;
766
767 000003BD 66E8C7FEFFFF call dword _a20_func_ena_kbc
768
769 000003C3 66E86A030000 call dword .test_wraparound
770 000003C9 0F843401 jz .kbc_A20
771
772 ; Turn it off, so I can see if I need to set BOTH kbc and port 0x92 later
773 000003CD 66E8DBFEFFFF call dword _a20_func_dis_kbc
774
775 ;
776 ; Try to use port 0xEE
777 ;
778
779 000003D3 66E8F5FEFFFF call dword _a20_func_ena_port_ee
780
781 000003D9 66E854030000 call dword .test_wraparound
782 000003DF 0F848701 jz .kbc_port_EE
783
784 ; Turn it off
785 000003E3 66E8EBFEFFFF call dword _a20_func_dis_port_ee
786
787 ;
788 ; Try to use port 0x92
789 ;
790
791 000003E9 66E8EDFEFFFF call dword _a20_func_ena_port_92
792
793 000003EF 66E83E030000 call dword .test_wraparound
794 000003F5 0F84DE01 jz .kbc_port_92
795
796 ; Turn it off
797 000003F9 66E8E9FEFFFF call dword _a20_func_dis_port_92
798
799 ;
800 ; Try to use BOTH port 0x92 and kbc
801 ;
802
803 000003FF 66E8EDFEFFFF call dword _a20_func_ena_port_92_kbc
804
805 00000405 66E828030000 call dword .test_wraparound
806 0000040B 0F843502 jz .kbc_port_92_kbc
807
808 ; Turn it off
809 0000040F 66E8EBFEFFFF call dword _a20_func_dis_port_92_kbc
810
811 ;
812 ; Try issuing keyboard controller command (HP Vectra)
813 ;
814
815 00000415 66E8F3FEFFFF call dword _a20_func_ena_kbc_cmd
816
817 0000041B 66E812030000 call dword .test_wraparound
818 00000421 0F849302 jz .kbc_cmd
819
820 00000425 66E8E3FEFFFF call dword _a20_func_ena_kbc_cmd
821
822 ;
823 ; Forget it. This motherboard is too incompatible.
824 ;
825
826 0000042B F9 stc
827 0000042C E9F902 jmp .done
828
829 .null_A20:
830 safemsg "A20: Already on"
831 <1> %if 1
832 0000042F EB12 <1> jmp %%overtext
833 00000431 0A4132303A20416C72- <1> %%msg: db 10,%1,10,0
834 0000043A 65616479206F6E0A00 <1>
835 <1> %%overtext:
836 00000443 6660 <1> pushad
837 00000445 6606 <1> o32 push es
838 00000447 B800B8 <1> mov ax,0xb800
839 0000044A 8EC0 <1> mov es,ax
840 0000044C 66BE[31040000] <1> mov esi,%%msg
841 00000452 31FF <1> xor di,di
842 <1> %%another:
843 00000454 AC <1> lodsb
844 00000455 3C00 <1> cmp al,0
845 00000457 7406 <1> jz %%done
846 00000459 AA <1> stosb
847 0000045A B007 <1> mov al,7
848 0000045C AA <1> stosb
849 0000045D EBF5 <1> jmp %%another
850 <1> %%done:
851 <1>
852 0000045F B80008 <1> mov ax,0x0800
853 <1> %%another2:
854 00000462 AB <1> stosw
855 00000463 81FFA000 <1> cmp di,80*2
856 00000467 72F9 <1> jb %%another2
857 <1>
858 <1> %if USE_MSG_DELAY
859 <1> mov ecx,200000000
860 <1> %else
861 00000469 66B901000000 <1> mov ecx,1
862 <1> %endif
863 <1>
864 <1> %%spin:
865 0000046F 6649 <1> dec ecx
866 00000471 75FC <1> jnz %%spin
867 <1>
868 00000473 6607 <1> o32 pop es
869 00000475 6661 <1> popad
870 <1> %endif
871 ; The A20 line was already enabled. Don't touch it ever.
872 00000477 6667C705[00000000]- mov dword [dword _ena_A20_vec],_a20_func_null
873 0000047F [5E020000]
874 00000483 6667C705[04000000]- mov dword [dword _dis_A20_vec],_a20_func_null
875 0000048B [5E020000]
876 0000048F F8 clc
877 00000490 E99502 jmp .done
878
879 .bios_A20:
880 safemsg "A20: Using BIOS"
881 <1> %if 1
882 00000493 EB12 <1> jmp %%overtext
883 00000495 0A4132303A20557369- <1> %%msg: db 10,%1,10,0
884 0000049E 6E672042494F530A00 <1>
885 <1> %%overtext:
886 000004A7 6660 <1> pushad
887 000004A9 6606 <1> o32 push es
888 000004AB B800B8 <1> mov ax,0xb800
889 000004AE 8EC0 <1> mov es,ax
890 000004B0 66BE[95040000] <1> mov esi,%%msg
891 000004B6 31FF <1> xor di,di
892 <1> %%another:
893 000004B8 AC <1> lodsb
894 000004B9 3C00 <1> cmp al,0
895 000004BB 7406 <1> jz %%done
896 000004BD AA <1> stosb
897 000004BE B007 <1> mov al,7
898 000004C0 AA <1> stosb
899 000004C1 EBF5 <1> jmp %%another
900 <1> %%done:
901 <1>
902 000004C3 B80008 <1> mov ax,0x0800
903 <1> %%another2:
904 000004C6 AB <1> stosw
905 000004C7 81FFA000 <1> cmp di,80*2
906 000004CB 72F9 <1> jb %%another2
907 <1>
908 <1> %if USE_MSG_DELAY
909 <1> mov ecx,200000000
910 <1> %else
911 000004CD 66B901000000 <1> mov ecx,1
912 <1> %endif
913 <1>
914 <1> %%spin:
915 000004D3 6649 <1> dec ecx
916 000004D5 75FC <1> jnz %%spin
917 <1>
918 000004D7 6607 <1> o32 pop es
919 000004D9 6661 <1> popad
920 <1> %endif
921 ; Turn it off again, I was just testing
922 000004DB 66E89EFDFFFF call dword _a20_func_dis_bios
923 000004E1 0F82D8FE jc .bios_A20_failed
924 ; Success
925 000004E5 6667C705[00000000]- mov dword [dword _ena_A20_vec],_a20_func_ena_bios
926 000004ED [74020000]
927 000004F1 6667C705[04000000]- mov dword [dword _dis_A20_vec],_a20_func_dis_bios
928 000004F9 [7F020000]
929 000004FD F8 clc
930 000004FE E92702 jmp .done
931
932 .kbc_A20:
933 safemsg "A20: Using KBC"
934 <1> %if 1
935 00000501 EB11 <1> jmp %%overtext
936 00000503 0A4132303A20557369- <1> %%msg: db 10,%1,10,0
937 0000050C 6E67204B42430A00 <1>
938 <1> %%overtext:
939 00000514 6660 <1> pushad
940 00000516 6606 <1> o32 push es
941 00000518 B800B8 <1> mov ax,0xb800
942 0000051B 8EC0 <1> mov es,ax
943 0000051D 66BE[03050000] <1> mov esi,%%msg
944 00000523 31FF <1> xor di,di
945 <1> %%another:
946 00000525 AC <1> lodsb
947 00000526 3C00 <1> cmp al,0
948 00000528 7406 <1> jz %%done
949 0000052A AA <1> stosb
950 0000052B B007 <1> mov al,7
951 0000052D AA <1> stosb
952 0000052E EBF5 <1> jmp %%another
953 <1> %%done:
954 <1>
955 00000530 B80008 <1> mov ax,0x0800
956 <1> %%another2:
957 00000533 AB <1> stosw
958 00000534 81FFA000 <1> cmp di,80*2
959 00000538 72F9 <1> jb %%another2
960 <1>
961 <1> %if USE_MSG_DELAY
962 <1> mov ecx,200000000
963 <1> %else
964 0000053A 66B901000000 <1> mov ecx,1
965 <1> %endif
966 <1>
967 <1> %%spin:
968 00000540 6649 <1> dec ecx
969 00000542 75FC <1> jnz %%spin
970 <1>
971 00000544 6607 <1> o32 pop es
972 00000546 6661 <1> popad
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -