1 #------------------------------------------------------------------------------
3 #* Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
4 #* This program and the accompanying materials
5 #* are licensed and made available under the terms and conditions of the BSD License
6 #* which accompanies this distribution. The full text of the license may be found at
7 #* http://opensource.org/licenses/bsd-license.php
9 #* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 #* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #------------------------------------------------------------------------------
18 ##############################################################################
19 # Now in 64-bit long mode.
20 ##############################################################################
30 .equ DEFAULT_HANDLER_SIZE, INT1 - INT0
32 .macro jmpCommonIdtEntry
33 # jmp commonIdtEntry - this must be hand coded to keep the assembler from
34 # using a 8 bit reletive jump when the entries are
35 # within 255 bytes of the common entry. This must
36 # be done to maintain the consistency of the size
38 .byte 0xe9 # jmp 16 bit relative
39 .long commonIdtEntry - . - 4 # offset to jump to
45 movl $0x001fffe8,%esp # make final stack aligned
47 # set OSFXSR and OSXMMEXCPT because some code will use XMM register
61 # Populate IDT with meaningful offsets for exception handlers...
66 movl %eax,%ebx # use bx to copy 15..0 to descriptors
67 shrl $16,%eax # use ax to copy 31..16 to descriptors
68 # 63..32 of descriptors is 0
69 movl $0x78,%ecx # 78h IDT entries to initialize with unique entry points (exceptions)
73 LOOP_1: # loop through all IDT entries exception handlers and initialize to default handler
74 movw %bx, (%edi) # write bits 15..0 of offset
75 movw $0x38, 2(%edi) # SYS_CODE_SEL64 from GDT
76 movw $(0x0e00 | 0x8000), 4(%edi) # type = 386 interrupt gate, present
77 movw %ax, 6(%edi) # write bits 31..16 of offset
78 movl $0, 8(%edi) # write bits 31..16 of offset
79 addl $16, %edi # move up to next descriptor
80 addw DEFAULT_HANDLER_SIZE, %bx # move to next entry point
81 loopl LOOP_1 # loop back through again until all descriptors are initialized
83 ## at this point edi contains the offset of the descriptor for INT 20
84 ## and bx contains the low 16 bits of the offset of the default handler
85 ## so initialize all the rest of the descriptors with these two values...
86 # mov ecx, 101 ; there are 100 descriptors left (INT 20 (14h) - INT 119 (77h)
87 #@@: ; loop through all IDT entries exception handlers and initialize to default handler
88 # mov word ptr [edi], bx ; write bits 15..0 of offset
89 # mov word ptr [edi+2], 38h ; SYS_CODE64_SEL from GDT
90 # mov word ptr [edi+4], 0e00h OR 8000h ; type = 386 interrupt gate, present
91 # mov word ptr [edi+6], ax ; write bits 31..16 of offset
92 # mov dword ptr [edi+8], 0 ; write bits 63..32 of offset
93 # add edi, 16 ; move up to next descriptor
94 # loop @b ; loop back through again until all descriptors are initialized
97 ## DUMP location of IDT and several of the descriptors
99 # mov eax, [offset Idtr + 2]
108 ## just for fun, let's do a software interrupt to see if we correctly land in the exception handler...
109 # mov eax, 011111111h
110 # mov ebx, 022222222h
111 # mov ecx, 033333333h
112 # mov edx, 044444444h
113 # mov ebp, 055555555h
114 # mov esi, 066666666h
115 # mov edi, 077777777h
121 movl $0x22000,%esi # esi = 22000
122 movl 0x14(%esi),%eax # eax = [22014]
123 addl %eax,%esi # esi = 22000 + [22014] = Base of EFILDR.C
124 movl 0x3c(%esi),%ebp # ebp = [22000 + [22014] + 3c] = NT Image Header for EFILDR.C
126 movl 0x30(%ebp),%edi # edi = [[22000 + [22014] + 3c] + 2c] = ImageBase (63..32 is zero, ignore)
127 movl 0x28(%ebp),%eax # eax = [[22000 + [22014] + 3c] + 24] = EntryPoint
128 addl %edi,%eax # eax = ImageBase + EntryPoint
129 movl %ebx, EfiLdrOffset
130 movl %eax, (%ebx) # Modify far jump instruction for correct entry point
132 movw 6(%ebp), %bx # bx = Number of sections
134 movw 0x14(%ebp), %ax # ax = Optional Header Size
136 addl $0x18,%ebp # ebp = Start of 1st Section
139 pushl %esi # Save Base of EFILDR.C
140 pushl %edi # Save ImageBase
141 addl 0x14(%ebp),%esi # esi = Base of EFILDR.C + PointerToRawData
142 addl 0x0c(%ebp),%edi # edi = ImageBase + VirtualAddress
143 movl 0x10(%ebp),%ecx # ecs = SizeOfRawData
150 popl %edi # Restore ImageBase
151 popl %esi # Restore Base of EFILDR.C
153 addw $0x28,%bp # ebp = ebp + 028h = Pointer to next section record
161 movl (Idtr), %eax # get size of IDT
166 addl 2(%edx), %eax # add to base of IDT to get location of memory map...
168 movl %eax,%ecx # put argument to RCX
174 .long 0x00401000 # Offset of EFILDR
182 # db "**** DEFAULT IDT ENTRY ***",0
186 pushl $0x0 # push error code place holder on the stack
189 # db 0e9h ; jmp 16 bit reletive
190 # dd commonIdtEntry - $ - 4 ; offset to jump to
193 pushl $0x0 # push error code place holder on the stack
198 pushl $0x0 # push error code place holder on the stack
203 pushl $0x0 # push error code place holder on the stack
208 pushl $0x0 # push error code place holder on the stack
213 pushl $0x0 # push error code place holder on the stack
218 pushl $0x0 # push error code place holder on the stack
223 pushl $0x0 # push error code place holder on the stack
228 # Double fault causes an error code to be pushed so no phony push necessary
235 pushl $0x0 # push error code place holder on the stack
240 # Invalid TSS causes an error code to be pushed so no phony push necessary
247 # Segment Not Present causes an error code to be pushed so no phony push necessary
254 # Stack fault causes an error code to be pushed so no phony push necessary
261 # GP fault causes an error code to be pushed so no phony push necessary
268 # Page fault causes an error code to be pushed so no phony push necessary
275 pushl $0x0 # push error code place holder on the stack
280 pushl $0x0 # push error code place holder on the stack
285 # Alignment check causes an error code to be pushed so no phony push necessary
292 pushl $0x0 # push error code place holder on the stack
297 pushl $0x0 # push error code place holder on the stack
302 # The following segment repeats (0x78 - 20) times:
304 pushl $0x0 # push error code place holder on the stack
305 # push xxh ; push vector number
307 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
310 pushl $0x0 # push error code place holder on the stack
311 # push xxh ; push vector number
313 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
316 pushl $0x0 # push error code place holder on the stack
317 # push xxh ; push vector number
319 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
322 pushl $0x0 # push error code place holder on the stack
323 # push xxh ; push vector number
325 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
328 pushl $0x0 # push error code place holder on the stack
329 # push xxh ; push vector number
331 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
334 pushl $0x0 # push error code place holder on the stack
335 # push xxh ; push vector number
337 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
340 pushl $0x0 # push error code place holder on the stack
341 # push xxh ; push vector number
343 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
346 pushl $0x0 # push error code place holder on the stack
347 # push xxh ; push vector number
349 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
352 pushl $0x0 # push error code place holder on the stack
353 # push xxh ; push vector number
355 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
358 pushl $0x0 # push error code place holder on the stack
359 # push xxh ; push vector number
361 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
364 pushl $0x0 # push error code place holder on the stack
365 # push xxh ; push vector number
367 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
370 pushl $0x0 # push error code place holder on the stack
371 # push xxh ; push vector number
373 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
376 pushl $0x0 # push error code place holder on the stack
377 # push xxh ; push vector number
379 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
382 pushl $0x0 # push error code place holder on the stack
383 # push xxh ; push vector number
385 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
388 pushl $0x0 # push error code place holder on the stack
389 # push xxh ; push vector number
391 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
394 pushl $0x0 # push error code place holder on the stack
395 # push xxh ; push vector number
397 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
400 pushl $0x0 # push error code place holder on the stack
401 # push xxh ; push vector number
403 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
406 pushl $0x0 # push error code place holder on the stack
407 # push xxh ; push vector number
409 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
412 pushl $0x0 # push error code place holder on the stack
413 # push xxh ; push vector number
415 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
418 pushl $0x0 # push error code place holder on the stack
419 # push xxh ; push vector number
421 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
424 pushl $0x0 # push error code place holder on the stack
425 # push xxh ; push vector number
427 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
430 pushl $0x0 # push error code place holder on the stack
431 # push xxh ; push vector number
433 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
436 pushl $0x0 # push error code place holder on the stack
437 # push xxh ; push vector number
439 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
442 pushl $0x0 # push error code place holder on the stack
443 # push xxh ; push vector number
445 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
448 pushl $0x0 # push error code place holder on the stack
449 # push xxh ; push vector number
451 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
454 pushl $0x0 # push error code place holder on the stack
455 # push xxh ; push vector number
457 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
460 pushl $0x0 # push error code place holder on the stack
461 # push xxh ; push vector number
463 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
466 pushl $0x0 # push error code place holder on the stack
467 # push xxh ; push vector number
469 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
472 pushl $0x0 # push error code place holder on the stack
473 # push xxh ; push vector number
475 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
478 pushl $0x0 # push error code place holder on the stack
479 # push xxh ; push vector number
481 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
484 pushl $0x0 # push error code place holder on the stack
485 # push xxh ; push vector number
487 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
490 pushl $0x0 # push error code place holder on the stack
491 # push xxh ; push vector number
493 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
496 pushl $0x0 # push error code place holder on the stack
497 # push xxh ; push vector number
499 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
502 pushl $0x0 # push error code place holder on the stack
503 # push xxh ; push vector number
505 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
508 pushl $0x0 # push error code place holder on the stack
509 # push xxh ; push vector number
511 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
514 pushl $0x0 # push error code place holder on the stack
515 # push xxh ; push vector number
517 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
520 pushl $0x0 # push error code place holder on the stack
521 # push xxh ; push vector number
523 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
526 pushl $0x0 # push error code place holder on the stack
527 # push xxh ; push vector number
529 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
532 pushl $0x0 # push error code place holder on the stack
533 # push xxh ; push vector number
535 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
538 pushl $0x0 # push error code place holder on the stack
539 # push xxh ; push vector number
541 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
544 pushl $0x0 # push error code place holder on the stack
545 # push xxh ; push vector number
547 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
550 pushl $0x0 # push error code place holder on the stack
551 # push xxh ; push vector number
553 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
556 pushl $0x0 # push error code place holder on the stack
557 # push xxh ; push vector number
559 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
562 pushl $0x0 # push error code place holder on the stack
563 # push xxh ; push vector number
565 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
568 pushl $0x0 # push error code place holder on the stack
569 # push xxh ; push vector number
571 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
574 pushl $0x0 # push error code place holder on the stack
575 # push xxh ; push vector number
577 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
580 pushl $0x0 # push error code place holder on the stack
581 # push xxh ; push vector number
583 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
586 pushl $0x0 # push error code place holder on the stack
587 # push xxh ; push vector number
589 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
592 pushl $0x0 # push error code place holder on the stack
593 # push xxh ; push vector number
595 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
598 pushl $0x0 # push error code place holder on the stack
599 # push xxh ; push vector number
601 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
604 pushl $0x0 # push error code place holder on the stack
605 # push xxh ; push vector number
607 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
610 pushl $0x0 # push error code place holder on the stack
611 # push xxh ; push vector number
613 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
616 pushl $0x0 # push error code place holder on the stack
617 # push xxh ; push vector number
619 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
622 pushl $0x0 # push error code place holder on the stack
623 # push xxh ; push vector number
625 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
628 pushl $0x0 # push error code place holder on the stack
629 # push xxh ; push vector number
631 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
634 pushl $0x0 # push error code place holder on the stack
635 # push xxh ; push vector number
637 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
640 pushl $0x0 # push error code place holder on the stack
641 # push xxh ; push vector number
643 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
646 pushl $0x0 # push error code place holder on the stack
647 # push xxh ; push vector number
649 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
652 pushl $0x0 # push error code place holder on the stack
653 # push xxh ; push vector number
655 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
658 pushl $0x0 # push error code place holder on the stack
659 # push xxh ; push vector number
661 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
664 pushl $0x0 # push error code place holder on the stack
665 # push xxh ; push vector number
667 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
670 pushl $0x0 # push error code place holder on the stack
671 # push xxh ; push vector number
673 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
676 pushl $0x0 # push error code place holder on the stack
677 # push xxh ; push vector number
679 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
682 pushl $0x0 # push error code place holder on the stack
683 # push xxh ; push vector number
685 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
688 pushl $0x0 # push error code place holder on the stack
689 # push xxh ; push vector number
691 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
694 pushl $0x0 # push error code place holder on the stack
695 # push xxh ; push vector number
697 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
700 pushl $0x0 # push error code place holder on the stack
701 # push xxh ; push vector number
703 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
706 pushl $0x0 # push error code place holder on the stack
707 # push xxh ; push vector number
709 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
712 pushl $0x0 # push error code place holder on the stack
713 # push xxh ; push vector number
715 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
718 pushl $0x0 # push error code place holder on the stack
719 # push xxh ; push vector number
721 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
724 pushl $0x0 # push error code place holder on the stack
725 # push xxh ; push vector number
727 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
730 pushl $0x0 # push error code place holder on the stack
731 # push xxh ; push vector number
733 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
736 pushl $0x0 # push error code place holder on the stack
737 # push xxh ; push vector number
739 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
742 pushl $0x0 # push error code place holder on the stack
743 # push xxh ; push vector number
745 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
748 pushl $0x0 # push error code place holder on the stack
749 # push xxh ; push vector number
751 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
754 pushl $0x0 # push error code place holder on the stack
755 # push xxh ; push vector number
757 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
760 pushl $0x0 # push error code place holder on the stack
761 # push xxh ; push vector number
763 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
766 pushl $0x0 # push error code place holder on the stack
767 # push xxh ; push vector number
769 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
772 pushl $0x0 # push error code place holder on the stack
773 # push xxh ; push vector number
775 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
778 pushl $0x0 # push error code place holder on the stack
779 # push xxh ; push vector number
781 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
784 pushl $0x0 # push error code place holder on the stack
785 # push xxh ; push vector number
787 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
790 pushl $0x0 # push error code place holder on the stack
791 # push xxh ; push vector number
793 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
796 pushl $0x0 # push error code place holder on the stack
797 # push xxh ; push vector number
799 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
802 pushl $0x0 # push error code place holder on the stack
803 # push xxh ; push vector number
805 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
808 pushl $0x0 # push error code place holder on the stack
809 # push xxh ; push vector number
811 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
814 pushl $0x0 # push error code place holder on the stack
815 # push xxh ; push vector number
817 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
820 pushl $0x0 # push error code place holder on the stack
821 # push xxh ; push vector number
823 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
826 pushl $0x0 # push error code place holder on the stack
827 # push xxh ; push vector number
829 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
832 pushl $0x0 # push error code place holder on the stack
833 # push xxh ; push vector number
835 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
838 pushl $0x0 # push error code place holder on the stack
839 # push xxh ; push vector number
841 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
844 pushl $0x0 # push error code place holder on the stack
845 # push xxh ; push vector number
847 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
850 pushl $0x0 # push error code place holder on the stack
851 # push xxh ; push vector number
853 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
856 pushl $0x0 # push error code place holder on the stack
857 # push xxh ; push vector number
859 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
862 pushl $0x0 # push error code place holder on the stack
863 # push xxh ; push vector number
865 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
868 pushl $0x0 # push error code place holder on the stack
869 # push xxh ; push vector number
871 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
874 pushl $0x0 # push error code place holder on the stack
875 # push xxh ; push vector number
877 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
880 pushl $0x0 # push error code place holder on the stack
881 # push xxh ; push vector number
883 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
886 pushl $0x0 # push error code place holder on the stack
887 # push xxh ; push vector number
889 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
892 pushl $0x0 # push error code place holder on the stack
893 # push xxh ; push vector number
895 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
898 pushl $0x0 # push error code place holder on the stack
899 # push xxh ; push vector number
901 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
943 ## At this point the stack looks like this:
951 ## Int num or 0ffh for unknown int num
967 ## r15 <------- RSP, RBP
974 movl 16*8(%ebp),%eax ## move Int number into RAX
977 ja PrintDefaultString
978 PrintExceptionString:
979 shll $3,%eax ## multiply by 8 to get offset from StringTable to actual string address
980 addl StringTable, %eax
984 movl IntUnknownString, %esi
998 movl 19*8(%ebp),%eax # CS
1004 movl 18*8(%ebp),%eax # RIP
1011 movl StringRax, %esi
1014 movl 15*8(%ebp),%eax
1017 movl StringRcx, %esi
1020 movl 14*8(%ebp),%eax
1023 movl StringRdx, %esi
1026 movl 13*8(%ebp),%eax
1031 movl StringRbx, %esi
1034 movl 12*8(%ebp),%eax
1037 movl StringRsp, %esi
1040 movl 21*8(%ebp),%eax
1043 movl StringRbp, %esi
1046 movl 10*8(%ebp),%eax
1051 movl StringRsi, %esi
1057 movl StringRdi, %esi
1063 movl StringEcode, %esi
1066 movl 17*8(%ebp),%eax
1083 movl StringR10, %esi
1091 movl StringR11, %esi
1097 movl StringR12, %esi
1103 movl StringR13, %esi
1111 movl StringR14, %esi
1117 movl StringR15, %esi
1126 movl 22*8(%ebp),%eax
1131 movl StringRflags, %esi
1134 movl 20*8(%ebp),%eax
1169 movl 18*8(%ebp),%eax # RIP
1172 movl %eax,%esi # esi = rip - 8 QWORD linear (total 16 QWORD)
1244 # add esp, 16 ; error code and INT number
1266 ## RAX contains qword to print
1267 ## RDI contains memory location (screen location) to print it to
1326 String1: .asciz "*** INT "
1328 Int0String: .asciz "00h Divide by 0 -"
1329 Int1String: .asciz "01h Debug exception -"
1330 Int2String: .asciz "02h NMI -"
1331 Int3String: .asciz "03h Breakpoint -"
1332 Int4String: .asciz "04h Overflow -"
1333 Int5String: .asciz "05h Bound -"
1334 Int6String: .asciz "06h Invalid opcode -"
1335 Int7String: .asciz "07h Device not available -"
1336 Int8String: .asciz "08h Double fault -"
1337 Int9String: .asciz "09h Coprocessor seg overrun (reserved) -"
1338 Int10String: .asciz "0Ah Invalid TSS -"
1339 Int11String: .asciz "0Bh Segment not present -"
1340 Int12String: .asciz "0Ch Stack fault -"
1341 Int13String: .asciz "0Dh General protection fault -"
1342 Int14String: .asciz "0Eh Page fault -"
1343 Int15String: .asciz "0Fh (Intel reserved) -"
1344 Int16String: .asciz "10h Floating point error -"
1345 Int17String: .asciz "11h Alignment check -"
1346 Int18String: .asciz "12h Machine check -"
1347 Int19String: .asciz "13h SIMD Floating-Point Exception -"
1348 IntUnknownString: .asciz "??h Unknown interrupt -"
1350 StringTable: .long Int0String, Int1String, Int2String, Int3String, \
1351 Int4String, Int5String, Int6String, Int7String, \
1352 Int8String, Int9String, Int10String, Int11String, \
1353 Int12String, Int13String, Int14String, Int15String,\
1354 Int16String, Int17String, Int18String, Int19String
1356 String2: .asciz " HALT!! *** ("
1358 StringRax: .asciz "RAX="
1359 StringRcx: .asciz " RCX="
1360 StringRdx: .asciz " RDX="
1361 StringRbx: .asciz "RBX="
1362 StringRsp: .asciz " RSP="
1363 StringRbp: .asciz " RBP="
1364 StringRsi: .asciz "RSI="
1365 StringRdi: .asciz " RDI="
1366 StringEcode: .asciz " ECODE="
1367 StringR8: .asciz "R8 ="
1368 StringR9: .asciz " R9 ="
1369 StringR10: .asciz " R10="
1370 StringR11: .asciz "R11="
1371 StringR12: .asciz " R12="
1372 StringR13: .asciz " R13="
1373 StringR14: .asciz "R14="
1374 StringR15: .asciz " R15="
1375 StringSs: .asciz " SS ="
1376 StringRflags: .asciz "RFLAGS="