From 307eaac66d378c1f6150519123ec1204277464d9 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Sun, 26 Aug 2018 13:29:33 +1000 Subject: Updated the style of the code in lib/string.c to conform to the rest of the project. Added the system call 'sys_panic' as well as the corresponding library function panic() whose prototype is defined in unistd.h. This is to allow userspace programs to deliberately crash the kernel for the purpose of debugging. Added the element 'write' as a function pointer in the tty_struct structure. The purpose of this function pointer is to provide a means for the TTY subsystem to notify the device driver of any newly added data to the write queue. Added the tty_write() function to the TTY subsystem. This function will copy data provided by the user into the specified TTY device's write queue, blocking if the queue's buffer is full. tty_write() will then call the driver's write() function to notify it of new data. Added the rsint_tx() function to the serial driver to handle transmit interrupts by re-supplying the UART's transmit FIFO. --- lib/panic.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/panic.c (limited to 'lib/panic.c') diff --git a/lib/panic.c b/lib/panic.c new file mode 100644 index 0000000..a3eb0af --- /dev/null +++ b/lib/panic.c @@ -0,0 +1,8 @@ +#include + +void panic(void) { + __asm__ volatile ( + "int $0x80" + :: "a" (__SYS_panic) + ); +} -- cgit v1.3