From 904df7728750f70228638116683810f762894e7b Mon Sep 17 00:00:00 2001 From: c0repwn3r Date: Tue, 10 May 2022 09:35:19 -0400 Subject: [PATCH] GPF loop, yay --- bin/boot.bin | Bin 512 -> 512 bytes bin/kernel.bin | Bin 7027 -> 8704 bytes kernel.elf | Bin 0 -> 21380 bytes obj/kernel/kernel.o | Bin 5604 -> 5604 bytes obj/kernel/platform/interrupts/int.o | Bin 4072 -> 5620 bytes obj/kernel/platform/interrupts/int_lowlevel.o | Bin 2240 -> 3344 bytes os-image.bin | Bin 7539 -> 9216 bytes src/kernel/kernel.c | 2 +- src/kernel/platform/interrupts/int.c | 48 +++++++++++++++- src/kernel/platform/interrupts/int.h | 11 +++- .../platform/interrupts/int_lowlevel.asm | 53 ++++++++++++++++-- 11 files changed, 106 insertions(+), 8 deletions(-) create mode 100755 kernel.elf diff --git a/bin/boot.bin b/bin/boot.bin index 9a84534152acb62b4e0b43f21d2a5372a6d90276..a0c13b24e6f7b389abebb616fff9be95e80e1ae2 100644 GIT binary patch delta 13 UcmZo*X<*slz{n^#*^zNS02s#upa1{> delta 13 UcmZo*X<*slz{toq*^zNS02sIfod5s; diff --git a/bin/kernel.bin b/bin/kernel.bin index 746678e2ba3b18e71b6d36234d5b558b0dd2bd32..2713f0a33d2171c4ffbc7f669e756c2e83d71170 100755 GIT binary patch literal 8704 zcmeHMZERat89sKB#$;aYuI-j~>v~$oSfw>983VeZktRJ|!;;n{HAAqn-a6OuO&s6g zkCdQfL^9Rvc!@H^4~qEMR_*83@q-aIbxN`-Q7fbw4Ol?}bs|HzvzK~{OVZY@dCs}M zZqj=t1b?xWN51F0&w0=LKIc8>+$7rB8bUHRyvYya+4>Z7Bv~##oFju(ONSkEEKl%3 z@9*mHePZcKGCj6`SBmAwJhr4apPWfCr!Ad0mvE=r9h2RDzklgsGCjR)pT4p+d2UBK z$sF-v2l?S?;d1@0182$3ls7MY%n}mMI*T! zHX@?n`b=)Z9NfW&sf`343^yGfZN_%1lPnK)u7=OV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y6DsVWm3|r4RUaQ2F7g zEcMaGU5$+mbWboyg(*VAazqXf$XyM52sso`BD6oOc89^$9|x2!OtM{y>{KG#sTAs> zA(hJC@5jIhRl`*2>klem9FxLfDHI)CIZQY`6p$$oiUt**9E!-)Cxz%y^rJQpoQ_2qdW-oMddy|K||T5aGOjcYAo!7o?%(W1g)W{91h3&qY#$cDP=vV6gY?^SSS5Sqqp@ys05i2qkzVO&P^M)kq&X~0z5S{Jozbb%y>e9cMUme@ ztdT#c9wP^1QL6fBGY>xk(g4;0=6;`wr9Gfh=pI)2N~mG7SB-J^`=nSf$``~i&`!CV zuch!Bj)h3G)I|?b-1n?W+ ZH1G%DZ@|9*8~#1D9{3#a2+;CB;NSk}IsX6v delta 843 zcmY+CO=uHA6vt;L-6mk^)>5Ha8?}uH8bN8LSXxRbS+yvdL&54PBE;B3ksiF6MiL=S zP>KVdf@~8I4}M{#lpZ985WjNJndz*8^}o`Xg33Y5SHumU~< z3w#I1HlR(w@R}My6KDnPU>Dd64uHd;7Yu+QZ~~kLBjCJyHrjk!QHEzPY_~Q1%d|hd CF@3ZE diff --git a/kernel.elf b/kernel.elf new file mode 100755 index 0000000000000000000000000000000000000000..4b3024f8f8c62e6d772e3112ba481dd92bf1aedf GIT binary patch literal 21380 zcmeHvdvsjInP=VGU9Fb7rEWcJOMbSD@dIqhlFi!~KWL1=Hd@|WSnqdfg!v$nK;W#lF6Cuk`v4*u>%H+!3hf5 z->>RcKiutPcmK#=?&G@md)4=S_0?B(>((v#zVODIEXxw+XA755SWt+SApUc==ByMU zVT;A0UIaDYRKR^(t1gl>)MNd-LA$#{m&bs=2D%4#@-O}_M&M!uE=J&D1TIG4VgxQm z;9>+WM&M!uE=J&D1TIG4Vg&xQ5g30RZ|$c(=@~tF=ydZ~*gG0Nb7=n=vDfv{r@XI* zC+G~Q->Jd@9v_IsVjul#^u&wj z>=%DKZ}g2NCq~2GL;JnrzUP$6#`7z_B9@KyOeh_%2yy7Ne=6r6=O)3SmxD)M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h-QdCU0f19ddP)j)?IH z+(m9YTSw!H{ti#Z6?nS4$i?ip8JY7AA%pmzCsr~ye$nh+(*AMCcJC;EDt6VqUW++v ze06o5ur75ub_(>r3+m>Zz^C9n1woa5Iao?vC4?E*ph;|O8t7p1J(Tf@4-K9*_>{rt zh*=@N4Ri*D_>qxcHFoZ%L{RRU?Bjj_A&eN@K*Wp5J(De%G1W5&QEoBcC+#XN(*f z{2USMx@houqyLV<9~%A3Mt;NKn+C5NM4{?9`mW<|2S;*qzp#&6DFe3~%p2Ti@IHfw z3?4Rk)ZizG$P-^uA#s&i%arwa$Onyl(%2s}vdD+$7V+=`qaenrR5|Gu~ESXrAt+>HGDgOUpq6FYW?-g zmzs-<`090!SqO@YK63tlX$+3o^3JQk+I_uiFm0rbX#Dw{LLV5>y|ugT!<0 zUdJecJqRP$!8>Qy@gR6R2CTRpi3VK?%ku5AJpI0g068*-tc~}sd)`y1eXf!7Qg7#7 z1aHTH6)(Z?OEQM6tp>R}-V);3^8nk4cMd$qa34vbifcKRVjJyWLhJVX6*l9q*2&mt z|H^y(p2x=u&tZq?!}cwM*6@A!MOFZEy`*oTb+6+$NS?WJU${SZUl_CNIK?L1l_@AW lH{Wjh(VwyGodPQ!gQ7;p5aW>Wbl>9lPt5zGw#1$F`wuJNGkE|2 diff --git a/obj/kernel/platform/interrupts/int_lowlevel.o b/obj/kernel/platform/interrupts/int_lowlevel.o index 98f9819729ccd5f2ab8a6c189699a2d00e5536fb..c3f6326ee98c5b44e0da5cdad88bbc28e30be3f5 100644 GIT binary patch literal 3344 zcmb7`T}TvB7>3XIZ)&Y+rlpw}p%m(jS_VQ!8D3aPbfGA$YmThjx~sEe*&hWd6v$#1 zQPht5N&*;X^k}^OQgx@f05>-%HpRQU}iGCDSRxm!F2DkSil3j6fZwpA+D*P z=4L1I37mNGP74l0D7{-NomuAzrM z5nqZg#FyhMD}NG+M7MN-E6;O&zd_K@4W{V^({+Oxy1`7{V3uw$TQ8WS7Zagez2G{% zSe{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,5 +50,5 @@ void main() { idt_init(); kernel_msg_ok("Interrupts initialized"); - __asm__ __volatile__("int $2"); + //__asm__ __volatile__("int $2"); } \ No newline at end of file diff --git a/src/kernel/platform/interrupts/int.c b/src/kernel/platform/interrupts/int.c index 3e63985..b1d79a1 100644 --- a/src/kernel/platform/interrupts/int.c +++ b/src/kernel/platform/interrupts/int.c @@ -1,8 +1,52 @@ #include "int.h" #include "../../print.h" -void exception_handler() { - print_str("I"); +char *exception_messages[] = { + "Division By Zero", + "Debug", + "Non Maskable Interrupt", + "Breakpoint", + "Into Detected Overflow", + "Out of Bounds", + "Invalid Opcode", + "No Coprocessor", + + "Double Fault", + "Coprocessor Segment Overrun", + "Bad TSS", + "Segment Not Present", + "Stack Fault", + "General Protection Fault", + "Page Fault", + "Unknown Interrupt", + + "Coprocessor Fault", + "Alignment Check", + "Machine Check", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved" +}; + +void exception_handler(registers_t r) { + print_str("int: "); + char s[3]; + int_to_ascii(r.int_no, s); + print_str(s); + print_str("\n"); + print_str(exception_messages[r.int_no]); + print_str("\n"); } void idt_set_descriptor(u8 vector, void* isr, u8 flags) { diff --git a/src/kernel/platform/interrupts/int.h b/src/kernel/platform/interrupts/int.h index a58b890..b82f7f5 100644 --- a/src/kernel/platform/interrupts/int.h +++ b/src/kernel/platform/interrupts/int.h @@ -21,8 +21,17 @@ typedef struct { static idtr_t idtr; +typedef struct { + u32 ds; // Data segment selector + u32 edi, esi, ebp, esp, ebx, edx, ecx, eax; // Pushed by pusha + u32 int_no, err_code; // Interrupt number and error code (if present) + u32 eip, cs, eflags, useresp, ss; // Pushed automatically by the CPU +} registers_t; + + + __attribute__((noreturn)) -void exception_handler(void); +void exception_handler(registers_t r); void idt_set_descriptor(u8 vector, void* isr, u8 flags); diff --git a/src/kernel/platform/interrupts/int_lowlevel.asm b/src/kernel/platform/interrupts/int_lowlevel.asm index a38fd41..e2a2094 100644 --- a/src/kernel/platform/interrupts/int_lowlevel.asm +++ b/src/kernel/platform/interrupts/int_lowlevel.asm @@ -1,13 +1,58 @@ %macro isr_err_stub 1 isr_stub_%+%1: - call exception_handler - iret + push byte %1 + + ; Save CPU state + pusha ; Pushes edi,esi,ebp,esp,ebx,edx,ecx,eax + mov ax, ds ; Lower 16-bits of eax = ds. + push eax ; save the data segment descriptor + mov ax, 0x10 ; kernel data segment descriptor + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + + call exception_handler ; Call C handler + + ; Restore CPU state + pop eax + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + popa + add esp, 8 ; Cleans up the pushed error code and pushed ISR number + sti + iret ; pops 5 things at once: CS, EIP, EFLAGS, SS, and ESP %endmacro ; if writing for 64-bit, use iretq instead %macro isr_no_err_stub 1 isr_stub_%+%1: - call exception_handler - iret + push byte 0 + push byte %1 + + ; Save CPU state + pusha ; Pushes edi,esi,ebp,esp,ebx,edx,ecx,eax + mov ax, ds ; Lower 16-bits of eax = ds. + push eax ; save the data segment descriptor + mov ax, 0x10 ; kernel data segment descriptor + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + + call exception_handler ; Call C handler + + ; Restore CPU state + pop eax + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + popa + add esp, 8 ; Cleans up the pushed error code and pushed ISR number + sti + iret ; pops 5 things at once: CS, EIP, EFLAGS, SS, and ESP %endmacro extern exception_handler