1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

Kernel: Implement serial port driver

This implements a basic 8250 UART serial port driver. It does not
currently handle (or enable) interrupts, nor any runtime configuration.
This commit is contained in:
Conrad Pankoff 2019-06-08 23:24:34 +10:00 committed by Andreas Kling
parent 7b04c7dc48
commit 8b1154f5f2
5 changed files with 244 additions and 0 deletions

View file

@ -17,6 +17,7 @@
#include <Kernel/Devices/NullDevice.h>
#include <Kernel/Devices/PS2MouseDevice.h>
#include <Kernel/Devices/RandomDevice.h>
#include <Kernel/Devices/SerialDevice.h>
#include <Kernel/Devices/ZeroDevice.h>
#include <Kernel/FileSystem/DevPtsFS.h>
#include <Kernel/FileSystem/Ext2FileSystem.h>
@ -40,6 +41,10 @@ KeyboardDevice* keyboard;
PS2MouseDevice* ps2mouse;
DebugLogDevice* dev_debuglog;
NullDevice* dev_null;
SerialDevice* ttyS0;
SerialDevice* ttyS1;
SerialDevice* ttyS2;
SerialDevice* ttyS3;
VFS* vfs;
#ifdef STRESS_TEST_SPAWNING
@ -173,6 +178,10 @@ extern "C" [[noreturn]] void init()
keyboard = new KeyboardDevice;
ps2mouse = new PS2MouseDevice;
dev_null = new NullDevice;
ttyS0 = new SerialDevice(SERIAL_COM1_ADDR, 64);
ttyS1 = new SerialDevice(SERIAL_COM2_ADDR, 65);
ttyS2 = new SerialDevice(SERIAL_COM3_ADDR, 66);
ttyS3 = new SerialDevice(SERIAL_COM4_ADDR, 67);
VirtualConsole::initialize();
tty0 = new VirtualConsole(0, VirtualConsole::AdoptCurrentVGABuffer);