Support for backtracing exceptions

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-12-27 02:36:38 +01:00
parent 82f3e4125f
commit 2fb24921d8
5 changed files with 249 additions and 0 deletions

View file

@ -108,6 +108,12 @@ gdt:
gdtdesc:
.word 0x27 /* limit */
.long gdt /* addr */
realidt:
.word 0
.long 0
protidt:
.word 0
.long 0
/*
* These next two routines, "real_to_prot" and "prot_to_real" are structured
@ -159,6 +165,9 @@ protcseg:
/* zero %eax */
xorl %eax, %eax
sidt realidt
lidt protidt
/* return on the old (or initialized) stack! */
ret
@ -166,6 +175,9 @@ prot_to_real:
/* just in case, set GDT */
lgdt gdtdesc
sidt protidt
lidt realidt
/* save the protected mode stack */
movl %esp, %eax
movl %eax, protstack