Commit Graph

8 Commits

Author SHA1 Message Date
Andreas Kling
94ca55cefd Meta: Add license header to source files
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.

For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.

Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
Andreas Kling
372f9e9a11 Kernel: Enable SMAP protection on IRQ and exception entry
It would be nice to do this in the assembly code, but we have to check
if the feature is available before doing a CLAC, so I've put this in
the C++ code for now.
2020-01-08 10:37:53 +01:00
Andreas Kling
f01fd54d1b Kernel: Make separate kernel entry points for each PIC IRQ
Instead of having a common entry point and looking at the PIC ISR to
figure out which IRQ we're servicing, just make a separate entryway
for each IRQ that pushes the IRQ number and jumps to a common routine.

This fixes a weird issue where incoming network packets would sometimes
cause the mouse to stop working. I didn't track it down further than
realizing we were sometimes EOI'ing the wrong IRQ.
2019-12-15 12:47:53 +01:00
Andreas Kling
b285a1944e Kernel: Clear the x86 DF flag when entering the kernel
The SysV ABI says that the DF flag should be clear on function entry.
That means we have to clear it when jumping into the kernel from some
random userspace context.
2019-11-09 22:42:19 +01:00
Andreas Kling
9a4b117f48 Kernel: Simplify kernel entry points slightly
It was silly to push the address of the stack pointer when we can also
just change the callee argument to be a value type.
2019-11-06 13:15:55 +01:00
Andreas Kling
1c6f8d3cbd Kernel: Don't build with -mregparm=3
It was really confusing to have different calling conventions in kernel
and userspace. Also this has prevented us from linking with libgcc.
2019-11-06 13:04:47 +01:00
Drew Stratford
7fc903b97a Kernel: Add exception_code to RegisterDump.
Added the exception_code field to RegisterDump, removing the need
for RegisterDumpWithExceptionCode. To accomplish this, I had to
push a dummy exception code during some interrupt entries to properly
pad out the RegisterDump. Note that we also needed to change some code
in sys$sigreturn to deal with the new RegisterDump layout.
2019-10-07 16:39:47 +02:00
Andreas Kling
6c87d3afa9 Kernel: Move i8253.cpp => Arch/i386/PIT.cpp 2019-07-09 15:04:45 +02:00