summaryrefslogtreecommitdiff
path: root/kernel/panic.s
AgeCommit message (Collapse)Author
2018-08-07Fixed a bug where the panic() function called printf() instead ofJake Mannens
printk() to notify the user of the kernel panic. This resulted in a system call being made to the kernel itself and the machine not fully halting. Fixed an issue with the serial driver in which the functions rsputs() and rsread() will still attempt a data transfer even if serial_init() failed to detect and initialize a serial port. Added the ability for tasks to be interrupted whilst reading from the serial port. This was done by putting the task into TSTATE_INTERRUPTIBLE instead of TSTATE_UNINTERRUPTIBLE when waiting for data in the serial buffer. Furthermore, a check was introduced after the task wakes up to see if any data was put in the buffer, or if the task was awoken by another source. Changed the type pid_t from an unsigned 16-bit integer to a signed 16-bit integer. This was done to make passing PID's to certain functions easier. Added the new system call sys_kill which will allow one process to send a signal to another. Added the kill_proc() function to sched.c to kill a process. Currently, this works by nullifying the PID field in the process' task structure, marking all the pages mapped to it's address space as free for use, then calling the scheduler to switch to another runnable task (or to idle). Modified the default signal handler within the kernel to now handle the SIGKILL signal by calling kill_proc().
2018-06-25Added the header asm/interrupt.h which includes a prototype for theJake Mannens
assembly function register_isr making it usable within the C portions of the source. Added a new file panic.s with the function panic that will print a panic message, disable interrupts and halt the system. Created the skeleton framework for paging in the new file page.s. The new function paging_init (called in kboot) will setup a simple page directory with two tables covering all addresses 0-8MB. It will also mark pages from 0-1MB as 'supervisor-only' to protect the kernel. NOTE: The function paging_init must be called before initialising the IDT as it does not disable interrupts! Modified the page fault handler to print the offending linear address along with the supplied error code. Following that, the handler will initiate a kernel panic. This function (along with panic) assumes console I/O to be operational. Modified the userspace test code to deliberately intiate a page fault by accessing an unmapped page.