Commit Graph

209 Commits

Author SHA1 Message Date
wash 3f992d84fb kernel: remove everything that is related to device/fs management
this is now a microkernel.
2024-09-17 17:47:50 +01:00
wash 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
wash 53e756eca0 kernel: add boot argument parsing 2023-12-27 17:34:59 +00:00
wash b8934d220c vm: increase the number of sparse memory sectors that can be created 2023-12-24 09:43:57 +00:00
wash 63b69d8d85 util: fix absdiff64() always over/underflowing 2023-12-24 09:36:41 +00:00
wash e9e73bc027 dev: removed internal spinlock from bcache
bcaches must now have an explicit external lock to protect them from
concurrent access (i.e. a lock belonging to their parent block device)
2023-07-11 21:28:02 +01:00
wash 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
wash 53440653f2 kernel: remove static qualifier from functions generated by btree convenience macros 2023-07-09 21:57:04 +01:00
wash 49f50859b5 dev: block device IO callbacks now use iovec 2023-07-09 09:06:36 +01:00
wash 8463423c10 kernel: add endian conversion functions 2023-07-08 22:14:31 +01:00
wash db992a0994 kernel: add status codes for device IO 2023-07-08 15:55:56 +01:00
wash d9b9c0d4e7 dev: implement block device registration 2023-07-08 15:55:43 +01:00
wash 71dbdf21a2 dev: allow devices to specify human-readable model names 2023-07-08 15:53:59 +01:00
wash d96c549f17 vm: allow pages to be mapped as no-cache 2023-07-08 15:53:06 +01:00
wash 65db7cfbda kernel: add filesystem model definitions 2023-06-25 11:03:44 +01:00
wash 1c20efc36e dev: add function to ref/deref device objects 2023-06-14 21:44:47 +01:00
wash 2656696757 tty: reading input from a tty is now handled by the line discipline 2023-06-14 17:38:11 +01:00
wash 4a1c6cae69 sched: add support for scheduling functions to be executed later 2023-06-14 17:36:45 +01:00
wash cdb9fef36c tty: remove tty event queues 2023-06-11 19:00:55 +01:00
wash a7c28e983c kernel: tty: implement tty input using line disciplines 2023-06-11 16:47:33 +01:00
wash 7308fd98fb dev: implement input event hooks 2023-06-11 16:46:58 +01:00
wash 3cc72f1f24 kernel: tty: support printing output from printk() 2023-06-11 14:55:47 +01:00
wash abe4af093e tty: implement read/write support 2023-06-11 09:23:57 +01:00
wash d09ad5838e kernel: implement tty driver system 2023-06-10 21:41:07 +01:00
wash c5edce612d dev: implement generic devices
generic devices don't have a type (char, block, etc) and are created
by bus drivers to represent the device until a suitable driver is found.

generic devices are registered by the bus driver. once a more suitable
driver is found, that driver will re-register the device under itself.
2023-06-10 13:21:42 +01:00
wash 20f77893cf dev: implement bus device enumeration 2023-06-09 21:24:51 +01:00
wash f83ecca490 dev: boot framebuffer support 2023-06-08 20:46:43 +01:00
wash ff8902ef1c kernel: add more status codes 2023-06-08 20:46:20 +01:00
wash cb220452db dev: start implementing framebuffer devices 2023-06-06 22:01:17 +01:00
wash b7b0691b8f dev: implement driver objects to organise and identify devices 2023-06-02 19:35:07 +01:00
wash 577abf3bba obj: implement link objects 2023-06-02 19:34:33 +01:00
wash fcf5dc32b9 kernel: add BITMAP_NPOS definition 2023-06-02 19:31:09 +01:00
wash d02d05d922 obj: add read() and write() object callbacks 2023-05-14 21:11:32 +01:00
wash 0238008986 dev: auto-generate device name in device_register if name is unspecified 2023-05-11 21:19:00 +01:00
wash 05395542a8 dev: implement writing/reading input events to/from input devices 2023-05-10 20:33:40 +01:00
wash 422d4fb375 kernel: implement ring-buffer data structure 2023-05-10 20:32:29 +01:00
wash 63f27adb1b sched: implement waitqueues 2023-05-10 20:29:57 +01:00
wash 1a633eee6b dev: implement object callbacks for devices. add misc device 2023-05-08 18:18:34 +01:00
wash 9f3c080e41 vm: minimum and maximum zone IDs are now defined in arch/../vm.h 2023-05-07 21:39:31 +01:00
wash a79d109fcc obj: add header-offset field to object_type
this allows the object header to be placed anywhere within the larger
object structure.

the object system now also ensures that the object is zero-initialised
during allocation.
2023-05-06 22:22:05 +01:00
wash 94ea756b31 kernel: write to all registered consoles with printk() 2023-05-06 21:32:19 +01:00
wash f52ca2f1e2 obj: object header is no longer allocated automatically 2023-05-06 19:48:14 +01:00
wash cec6b644ac kernel: add functions to query the number of available/online CPUs 2023-05-05 15:25:44 +01:00
wash 7d321fb7f0 sched: add kernel thread creation and SMP-aware thread scheduling 2023-05-04 21:43:18 +01:00
wash bb524c1576 kernel: add support for getting percpu variables that belong to other CPUs 2023-05-04 21:42:51 +01:00
wash c64577e24e sched: add function to create per-cpu idle threads 2023-05-03 19:27:18 +01:00
wash a52571eb19 kernel: add panic() function that accepts a cpu_context 2023-05-03 19:26:09 +01:00
wash 654e54653c x86_64: pmap: implement pmap_add() 2023-05-01 18:12:07 +01:00
wash 40762ffb95 kernel: add function to query the current preempt count 2023-05-01 08:26:41 +01:00
wash 8a0291c9b3 sched: add timer tasks and schedule_timeout() 2023-04-30 21:09:36 +01:00