Working PIT irqs, fix GDT bugs

This commit is contained in:
2025-12-09 17:14:01 +01:00
parent 9c8946de51
commit 64b14f3878
16 changed files with 382 additions and 138 deletions

View File

@ -33,7 +33,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.extern irq_fini
.section .text
#define EXCEPT_NOERR(exc) \
.global except ## exc; \
.type except ## exc, @function; \
@ -86,10 +85,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
EXCEPT_NOERR(128)
temp_except_hndlr:
pushal /* push eax, ecx, edx, ebx, esp, ebp, esi, edi (8*4) */
pushal
xorl %eax, %eax
mov %ds, %ax
push %eax /* save ds (4) */
push %eax
/* load kernel DS */
mov $0x10, %ax
@ -98,12 +97,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mov %ax, %fs
mov %ax, %gs
mov %cr3, %ecx
push %ecx
/* save frame (4) */
push %esp
call except_fini
add $0x04, %esp
/* restore DS */
@ -117,7 +114,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
popal
add $0x8, %esp
sti
iret
#define IRQ(irq1) \
@ -147,10 +143,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
IRQ(15)
temp_irq_hndlr:
pushal /* push eax, ecx, edx, ebx, esp, ebp, esi, edi (8*4) */
pushal
xorl %eax, %eax
mov %ds, %ax
push %eax /* save ds (4) */
push %eax
/* load kernel DS */
mov $0x10, %ax
@ -159,12 +155,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mov %ax, %fs
mov %ax, %gs
mov %cr3, %ecx
push %ecx
/* save frame (4) */
push %esp
call irq_fini
add $0x04, %esp
/* restore DS */
@ -178,5 +172,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
popal
add $0x8, %esp
sti
iret