Add support for running the BIOS version of iPXE in 64-bit long mode. A 64-bit BIOS version of iPXE can be built using e.g. make bin-x86_64-pcbios/ipxe.usb make bin-x86_64-pcbios/8086100e.mrom The 64-bit BIOS version should appear to function identically to the normal 32-bit BIOS version. The physical memory layout is unaltered: iPXE is still relocated to the top of the available 32-bit address space. The code is linked to a virtual address of 0xffffffffeb000000 (in the negative 2GB as required by -mcmodel=kernel), with 4kB pages created to cover the whole of .textdata. 2MB pages are created to cover the whole of the 32-bit address space. The 32-bit portions of the code run with VIRTUAL_CS and VIRTUAL_DS configured such that truncating a 64-bit virtual address gives a 32-bit virtual address pointing to the same physical location. The stack pointer remains as a physical address when running in long mode (although the .stack section is accessible via the negative 2GB virtual address); this is done in order to simplify the handling of interrupts occurring while executing a portion of 32-bit code with flat physical addressing via PHYS_CODE(). Interrupts may be enabled in either 64-bit long mode, 32-bit protected mode with virtual addresses, 32-bit protected mode with physical addresses, or 16-bit real mode. Interrupts occurring in any mode other than real mode will be reflected down to real mode and handled by whichever ISR is hooked into the BIOS interrupt vector table. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
151 |
|
151 |
|
152 |
|
152 |
|
153 |
|
153 |
|
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
154 |
|
157 |
|
155 |
|
158 |
|
156 |
|
159 |
|
|
|
||
14 |
|
14 |
|
15 |
|
15 |
|
16 |
|
16 |
|
|
17 |
|
|
17 |
|
18 |
|
18 |
|
19 |
|
19 |
|
20 |
|
|
|
||
286 |
|
287 |
|
287 |
|
288 |
|
288 |
|
289 |
|
289 |
|
|
|
290 |
|
|
|
|
290 |
|
|
|
291 |
|
|
291 |
|
292 |
|
292 |
|
293 |
|
293 |
|
294 |
|
294 |
|
295 |
|
295 |
|
296 |
|
296 |
|
297 |
|
297 |
|
|
|
298 |
|
|
|
|
298 |
|
|
|
299 |
|
|
|
300 |
|
|
|
301 |
|
|
|
302 |
|
|
|
303 |
|
|
|
304 |
|
|
|
305 |
|
|
|
306 |
|
|
|
307 |
|
|
299 |
|
308 |
|
300 |
|
309 |
|
301 |
|
310 |
|
|
|
||
308 |
|
317 |
|
309 |
|
318 |
|
310 |
|
319 |
|
|
320 |
|
|
|
321 |
|
|
|
322 |
|
|
|
323 |
|
|
|
324 |
|
|
|
325 |
|
|
|
326 |
|
|
|
327 |
|
|
|
328 |
|
|
|
329 |
|
|
|
330 |
|
|
|
331 |
|
|
|
332 |
|
|
|
333 |
|
|
|
334 |
|
|
|
335 |
|
|
|
336 |
|
|
|
337 |
|
|
311 |
|
338 |
|
312 |
|
339 |
|
313 |
|
340 |
|
314 |
|
341 |
|
315 |
|
342 |
|
316 |
|
343 |
|
|
344 |
|
|
|
345 |
|
|
|
346 |
|
|
317 |
|
347 |
|
318 |
|
348 |
|
319 |
|
349 |
|
320 |
|
350 |
|
321 |
|
|
|
|
351 |
|
|
322 |
|
352 |
|
323 |
|
353 |
|
324 |
|
354 |
|
325 |
|
355 |
|
326 |
|
|
|
327 |
|
|
|
|
356 |
|
|
|
357 |
|
|
328 |
|
358 |
|
329 |
|
359 |
|
330 |
|
360 |
|
|
|
||
337 |
|
367 |
|
338 |
|
368 |
|
339 |
|
369 |
|
340 |
|
|
|
341 |
|
|
|
|
370 |
|
|
|
371 |
|
|
342 |
|
372 |
|
343 |
|
373 |
|
344 |
|
374 |
|
|
|
||
19 |
|
19 |
|
20 |
|
20 |
|
21 |
|
21 |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
22 |
|
28 |
|
23 |
|
29 |
|
24 |
|
30 |
|
|
|
||
49 |
|
55 |
|
50 |
|
56 |
|
51 |
|
57 |
|
|
58 |
|
|
52 |
|
59 |
|
53 |
|
60 |
|
54 |
|
61 |
|
|
|
||
57 |
|
64 |
|
58 |
|
65 |
|
59 |
|
66 |
|
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
60 |
|
74 |
|
61 |
|
75 |
|
62 |
|
76 |
|
|
|
||
124 |
|
138 |
|
125 |
|
139 |
|
126 |
|
140 |
|
|
141 |
|
|
|
142 |
|
|
|
143 |
|
|
|
144 |
|
|
|
145 |
|
|
127 |
|
146 |
|
128 |
|
147 |
|
129 |
|
148 |
|
|
|
||
256 |
|
275 |
|
257 |
|
276 |
|
258 |
|
277 |
|
259 |
|
|
|
260 |
|
|
|
261 |
|
|
|
262 |
|
|
|
|
278 |
|
|
|
279 |
|
|
|
280 |
|
|
263 |
|
281 |
|
264 |
|
282 |
|
265 |
|
283 |
|
|
|
||
276 |
|
294 |
|
277 |
|
295 |
|
278 |
|
296 |
|
279 |
|
|
|
|
297 |
|
|
280 |
|
298 |
|
|
299 |
|
|
|
300 |
|
|
281 |
|
301 |
|
282 |
|
302 |
|
283 |
|
303 |
|
|
|
||
286 |
|
306 |
|
287 |
|
307 |
|
288 |
|
308 |
|
|
309 |
|
|
|
310 |
|
|
|
311 |
|
|
289 |
|
312 |
|
290 |
|
313 |
|
291 |
|
314 |
|
|
|
||
361 |
|
384 |
|
362 |
|
385 |
|
363 |
|
386 |
|
364 |
|
|
|
|
387 |
|
|
365 |
|
388 |
|
366 |
|
389 |
|
|
390 |
|
|
367 |
|
391 |
|
368 |
|
392 |
|
369 |
|
393 |
|
|
|
||
380 |
|
404 |
|
381 |
|
405 |
|
382 |
|
406 |
|
383 |
|
|
|
|
407 |
|
|
384 |
|
408 |
|
385 |
|
409 |
|
386 |
|
410 |
|
|
|
||
639 |
|
663 |
|
640 |
|
664 |
|
641 |
|
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 |
|
|
642 |
|
889 |
|
643 |
|
890 |
|
644 |
|
891 |
|
645 |
|
|
|
646 |
|
|
|
|
892 |
|
|
|
893 |
|
|
647 |
|
894 |
|
648 |
|
895 |
|
649 |
|
896 |
|
|
|
||
662 |
|
909 |
|
663 |
|
910 |
|
664 |
|
911 |
|
665 |
|
|
|
|
912 |
|
|
666 |
|
913 |
|
667 |
|
914 |
|
668 |
|
915 |
|
|
|
||
674 |
|
921 |
|
675 |
|
922 |
|
676 |
|
923 |
|
|
924 |
|
|
|
925 |
|
|
|
926 |
|
|
|
927 |
|
|
|
928 |
|
|
|
929 |
|
|
677 |
|
930 |
|
678 |
|
931 |
|
679 |
|
932 |
|
|
|
||
701 |
|
954 |
|
702 |
|
955 |
|
703 |
|
956 |
|
|
957 |
|
|
|
958 |
|
|
|
959 |
|
|
|
960 |
|
|
|
961 |
|
|
|
962 |
|
|
|
963 |
|
|
|
964 |
|
|
|
965 |
|
|
|
966 |
|
|
704 |
|
967 |
|
705 |
|
968 |
|
706 |
|
969 |
|
707 |
|
970 |
|
708 |
|
971 |
|
709 |
|
972 |
|
710 |
|
|
|
|
973 |
|
|
711 |
|
974 |
|
712 |
|
975 |
|
713 |
|
976 |
|
714 |
|
|
|
|
977 |
|
|
715 |
|
978 |
|
716 |
|
979 |
|
717 |
|
980 |
|
718 |
|
981 |
|
719 |
|
982 |
|
|
983 |
|
|
|
984 |
|
|
|
985 |
|
|
|
986 |
|
|
|
987 |
|
|
|
988 |
|
|
|
989 |
|
|
|
990 |
|
|
|
991 |
|
|
|
992 |
|
|
|
993 |
|
|
|
994 |
|
|
|
995 |
|
|
|
996 |
|
|
|
997 |
|
|
|
998 |
|
|
|
999 |
|
|
720 |
|
1000 |
|
721 |
|
1001 |
|
722 |
|
1002 |
|
|
|
||
725 |
|
1005 |
|
726 |
|
1006 |
|
727 |
|
1007 |
|
|
1008 |
|
|
|
1009 |
|
|
|
1010 |
|
|
|
1011 |
|
|
|
1012 |
|
|
|
1013 |
|
|
|
1014 |
|
|
|
1015 |
|
|
|
1016 |
|
|
|
1017 |
|
|
|
1018 |
|
|
728 |
|
1019 |
|
729 |
|
1020 |
|
730 |
|
1021 |
|
|
|
||
744 |
|
1035 |
|
745 |
|
1036 |
|
746 |
|
1037 |
|
|
1038 |
|
|
|
1039 |
|
|
|
1040 |
|
|
|
1041 |
|
|
747 |
|
1042 |
|
748 |
|
1043 |
|
|
1044 |
|
|
749 |
|
1045 |
|
750 |
|
|
|
|
1046 |
|
|
751 |
|
1047 |
|
752 |
|
1048 |
|
753 |
|
1049 |
|
754 |
|
1050 |
|
755 |
|
|
|
756 |
|
|
|
757 |
|
|
|
758 |
|
|
|
|
1051 |
|
|
|
1052 |
|
|
|
1053 |
|
|
|
1054 |
|
|
759 |
|
1055 |
|
760 |
|
1056 |
|
761 |
|
1057 |
|
|
|
||
769 |
|
1065 |
|
770 |
|
1066 |
|
771 |
|
1067 |
|
772 |
|
|
|
|
1068 |
|
|
|
1069 |
|
|
|
1070 |
|
|
|
1071 |
|
|
|
1072 |
|
|
773 |
|
1073 |
|
774 |
|
|
|
|
1074 |
|
|
775 |
|
1075 |
|
776 |
|
1076 |
|
777 |
|
1077 |
|
778 |
|
1078 |
|
779 |
|
|
|
|
1079 |
|
|
780 |
|
1080 |
|
781 |
|
1081 |
|
|
1082 |
|
|
|
1083 |
|
|
|
1084 |
|
|
|
1085 |
|
|
|
1086 |
|
|
782 |
|
1087 |
|
783 |
|
1088 |
|
784 |
|
1089 |
|
|
|
||
810 |
|
1115 |
|
811 |
|
1116 |
|
812 |
|
1117 |
|
|
1118 |
|
|
|
1119 |
|
|
|
1120 |
|
|
|
1121 |
|
|
|
1122 |
|
|
813 |
|
1123 |
|
814 |
|
1124 |
|
815 |
|
1125 |
|
|
|
||
830 |
|
1140 |
|
831 |
|
1141 |
|
832 |
|
1142 |
|
|
1143 |
|
|
833 |
|
1144 |
|
834 |
|
1145 |
|
835 |
|
1146 |
|
|
|
||
846 |
|
1157 |
|
847 |
|
1158 |
|
848 |
|
1159 |
|
849 |
|
|
|
|
1160 |
|
|
|
1161 |
|
|
|
1162 |
|
|
|
1163 |
|
|
|
1164 |
|
|
850 |
|
1165 |
|
851 |
|
|
|
|
1166 |
|
|
852 |
|
1167 |
|
853 |
|
1168 |
|
854 |
|
1169 |
|
855 |
|
1170 |
|
856 |
|
|
|
|
1171 |
|
|
857 |
|
1172 |
|
858 |
|
1173 |
|
|
1174 |
|
|
|
1175 |
|
|
|
1176 |
|
|
|
1177 |
|
|
|
1178 |
|
|
859 |
|
1179 |
|
860 |
|
1180 |
|
861 |
|
1181 |
|
|
|
||
874 |
|
1194 |
|
875 |
|
1195 |
|
876 |
|
1196 |
|
|
1197 |
|
|
|
1198 |
|
|
|
1199 |
|
|
|
1200 |
|
|
|
1201 |
|
|
877 |
|
1202 |
|
878 |
|
1203 |
|
879 |
|
1204 |
|
|
|
||
900 |
|
1225 |
|
901 |
|
1226 |
|
902 |
|
1227 |
|
903 |
|
|
|
|
1228 |
|
|
904 |
|
1229 |
|
905 |
|
1230 |
|
906 |
|
1231 |
|
907 |
|
1232 |
|
908 |
|
1233 |
|
909 |
|
1234 |
|
910 |
|
|
|
911 |
|
|
|
|
1235 |
|
|
|
1236 |
|
|
912 |
|
1237 |
|
913 |
|
1238 |
|
914 |
|
1239 |
|
|
|
||
917 |
|
1242 |
|
918 |
|
1243 |
|
919 |
|
1244 |
|
|
1245 |
|
|
|
1246 |
|
|
|
1247 |
|
|
|
1248 |
|
|
|
1249 |
|
|
|
1250 |
|
|
|
1251 |
|
|
|
1252 |
|
|
|
1253 |
|
|
|
1254 |
|
|
|
1255 |
|
|
|
1256 |
|
|
|
1257 |
|
|
|
1258 |
|
|
|
1259 |
|
|
|
1260 |
|
|
|
1261 |
|
|
|
1262 |
|
|
920 |
|
1263 |
|
921 |
|
1264 |
|
922 |
|
1265 |
|
|
|
||
927 |
|
1270 |
|
928 |
|
1271 |
|
929 |
|
1272 |
|
930 |
|
|
|
931 |
|
|
|
932 |
|
|
|
933 |
|
|
|
|
1273 |
|
|
|
1274 |
|
|
|
1275 |
|
|
|
1276 |
|
|
|
1277 |
|
|
|
1278 |
|
|
|
1279 |
|
|
|
1280 |
|
|
|
1281 |
|
|
|
1282 |
|
|
|
1283 |
|
|
|
1284 |
|
|
|
1285 |
|
|
|
1286 |
|
|
934 |
|
1287 |
|
935 |
|
1288 |
|
|
1289 |
|
|
|
1290 |
|
|
|
1291 |
|
|
|
1292 |
|
|
|
1293 |
|
|
|
1294 |
|
|
|
1295 |
|
|
|
1296 |
|
|
|
1297 |
|
|
|
1298 |
|
|
936 |
|
1299 |
|
937 |
|
|
|
|
1300 |
|
|
|
1301 |
|
|
|
1302 |
|
|
|
1303 |
|
|
|
1304 |
|
|
|
1305 |
|
|
938 |
|
1306 |
|
939 |
|
1307 |
|
940 |
|
1308 |
|
|
|
||
942 |
|
1310 |
|
943 |
|
1311 |
|
944 |
|
1312 |
|
945 |
|
|
|
946 |
|
|
|
947 |
|
|
|
|
1313 |
|
|
|
1314 |
|
|
|
1315 |
|
|
|
1316 |
|
|
|
1317 |
|
|
|
1318 |
|
|
|
1319 |
|
|
|
1320 |
|
|
|
1321 |
|
|
|
1322 |
|
|
|
1323 |
|
|
948 |
|
1324 |
|
949 |
|
1325 |
|
950 |
|
1326 |
|
|
|
||
1022 |
|
1398 |
|
1023 |
|
1399 |
|
1024 |
|
1400 |
|
1025 |
|
|
|
|
1401 |
|
|
1026 |
|
1402 |
|
1027 |
|
1403 |
|
1028 |
|
1404 |
|
|
|
||
1080 |
|
1456 |
|
1081 |
|
1457 |
|
1082 |
|
1458 |
|
1083 |
|
|
|
1084 |
|
|
|
1085 |
|
|
|
|
1459 |
|
|
1086 |
|
1460 |
|
1087 |
|
1461 |
|
1088 |
|
1462 |
|
|
|
||
23 |
|
23 |
|
24 |
|
24 |
|
25 |
|
25 |
|
26 |
|
|
|
27 |
|
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
28 |
|
38 |
|
29 |
|
39 |
|
30 |
|
|
|
31 |
|
|
|
|
40 |
|
|
|
41 |
|
|
32 |
|
42 |
|
33 |
|
43 |
|
34 |
|
44 |
|
|
|
||
75 |
|
85 |
|
76 |
|
86 |
|
77 |
|
87 |
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
|
84 |
|
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
85 |
|
109 |
|
86 |
|
110 |
|
87 |
|
111 |
|
|
|
||
95 |
|
119 |
|
96 |
|
120 |
|
97 |
|
121 |
|
98 |
|
|
|
|
122 |
|
|
99 |
|
123 |
|
100 |
|
124 |
|
101 |
|
125 |
|
|
|
||
107 |
|
131 |
|
108 |
|
132 |
|
109 |
|
133 |
|
110 |
|
|
|
111 |
|
|
|
|
134 |
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
|
|
|
138 |
|
|
|
139 |
|
|
|
140 |
|
|
|
141 |
|
|
112 |
|
142 |
|
113 |
|
143 |
|
114 |
|
144 |
|