Commit Graph

8 Commits

Author SHA1 Message Date
b0c021d4e9 kernel: add kernel.early-console and kernel.console boot args
kernel.early-console is used to specify which output device the
kernel boot log should be written to. the first thing the kernel
does on boot after initialising the bootstrap processor is initialise
the early console, making it useful for debugging problems that
occur early in the boot process. this arg accepts a list of hard-coded
values for output devices, such as tty0 for the display or ttyS0
for the serial port. the exact values supported will depend on the
platform.

once all drivers are loaded, the kernel switches to the device specified
by kernel.console for output. unlike kernel.early-console, this arg
specifies the name of a tty device in /dev/tty. this means that, not
only are more devices supported (any device provided by a tty driver),
but the kernel can also get input from the user using this console too
(not used by the kernel itself, but will be used by the user to interact
with userspace programs, like the shell).
2023-12-30 09:09:18 +00:00
3233169f25 dev: implement reading from block devices
reading from block devices is done using the block cache (bcache).
This cache stores sectors from a block device in pages of memory
marked as 'cached', which will allow them to be reclaimed when
memory pressure is high (TODO).

while block device drivers implement callbacks allowing reading/writing
at block-granularity, the device subsystem uses the block cache to
implement reading/writing at byte-granularity in a driver-agnostic way.

block drivers can disable the block cache for their devices, but this
will require that any clients communicate with the devices at
block-granularity.

also added an offset parameter to device and object read/write functions/callbacks.
2023-07-09 21:58:40 +01:00
31a4e00fdc tty: retain reference to foreground tty and input devices 2023-06-14 21:45:05 +01:00
cdb9fef36c tty: remove tty event queues 2023-06-11 19:00:55 +01:00
a7c28e983c kernel: tty: implement tty input using line disciplines 2023-06-11 16:47:33 +01:00
3cc72f1f24 kernel: tty: support printing output from printk() 2023-06-11 14:55:47 +01:00
abe4af093e tty: implement read/write support 2023-06-11 09:23:57 +01:00
d09ad5838e kernel: implement tty driver system 2023-06-10 21:41:07 +01:00