include: one folder per subsystem, and includes that name it

Sixty-five headers sat side by side in include/, so `#include "irq.h"`
said nothing about where irq.h was or what it belonged to, and errno.h,
stat.h and fcntl.h at the top shadowed the system's for any host tool
built with -I./include. They are in folders now -- arch/ core/ fs/
dev/ gfx/ net/ uapi/ (and ldls/ for the Linux driver layer) -- and
every include names the folder, as Linux's do: "core/proc.h".

Done mechanically and checked the hard way: the kernel built from this
tree disassembles identically to the one built from the tree before
it. The full image boots, and userland is the same set of programs.
Paths in docs and comments follow; docs/guides/layout.md has a table
of what is where, and tools/fix-includes.py rewrites old-style
includes from the folders in the tree, for code written before this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
This commit is contained in:
Nexoniarz 2026-10-23 15:05:12 +02:00
commit a1c965da1e
267 changed files with 1560 additions and 1440 deletions

View file

@ -1,22 +1,22 @@
// AudioEngine: the audio class, and /dev/dsp above it.
//
// See include/audio.h for what this is and what it deliberately is not. In
// See include/dev/audio.h for what this is and what it deliberately is not. In
// short: a program opens /dev/dsp, says what its samples are, writes them, and
// stops. Everything here is either the class vtable's thin wrapper or the part
// of "play this" that is not specific to a chip.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "device.h"
#include "audio.h"
#include "proc.h"
#include "uaccess.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "dev/device.h"
#include "dev/audio.h"
#include "core/proc.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
static struct spinlock audio_lock;
static int audio_lock_init;

View file

@ -18,19 +18,19 @@
// * B_DIRTY: the buffer data has been modified
// and needs to be written to disk.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "x86.h"
#include "fsstat.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "arch/x86.h"
#include "fs/fsstat.h"
#include "fs/blkdev.h"
#include "kmem.h"
#include "hwinfo.h"
#include "core/kmem.h"
#include "core/hwinfo.h"
struct fsstat fsstat;
@ -199,7 +199,7 @@ bdevrw_inner(struct buf *b)
return;
}
// SATA, NVMe and every partition: registered at probe time rather than
// known at build time. See include/blkdev.h.
// known at build time. See include/fs/blkdev.h.
if(b->dev >= BLKDEV_FIRST){
blkdev_rw(b);
return;

View file

@ -1,16 +1,16 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// The block device registry, and the partition tables on what is in it.
// See include/blkdev.h.
// See include/fs/blkdev.h.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "fs/blkdev.h"
struct blkdev {
int used;

View file

@ -1,12 +1,12 @@
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "x86.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/x86.h"
#include "uapi/errno.h"
extern int consoleread(struct inode*, uint64, char*, int);
extern int consolewrite(struct inode*, uint64, char*, int);
@ -203,14 +203,14 @@ struct devsw devsw[] = {
[8] = { diskread, diskwrite },
// /dev/pci (major 9) -- PCI devices reachable from userspace, for drivers
// that do not live in the kernel. Registers arrive through mmap and
// everything else through ioctl; see include/pciuser.h.
// everything else through ioctl; see include/dev/pciuser.h.
[9] = { pciuser_read, pciuser_write },
// /dev/dbg (major 10) -- ask the kernel a question. Write a line, read the
// answer; see include/dbg.h and docs/architecture/debugging.md.
// answer; see include/core/dbg.h and docs/architecture/debugging.md.
[10] = { dbg_read, dbg_write },
// /dev/netdev (major 11) -- a process, being a network interface. The
// reverse of major 9: that hands a device to a process, this lets a process
// be one. See include/netuser.h.
// be one. See include/net/netuser.h.
[11] = { netuser_read, netuser_write, netuser_ready },
// /dev/dsp (major 12) -- UNIX audio, kernel/dev/audio.c. Write PCM to it.
// The close hook plays out what is still queued: a program that writes a

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// /dev/dbg -- asking the kernel a question. See include/dbg.h.
// /dev/dbg -- asking the kernel a question. See include/core/dbg.h.
//
// The device is a conversation: write a line, read the answer.
//
@ -17,18 +17,18 @@
// other's. Making it per-open would mean a struct file hook for something that
// has exactly one user.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "errno.h"
#include "sbuf.h"
#include "memlayout.h"
#include "mmu.h"
#include "dbg.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "core/sbuf.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/dbg.h"
#define NVIEW 24
#define DBGBUF (16 * 1024)

View file

@ -1,4 +1,4 @@
// The device model. See include/device.h for why it exists.
// The device model. See include/dev/device.h for why it exists.
//
// A fixed table rather than a linked list: this is populated once during boot
// by whichever bus found each device, and read afterwards. Nothing is removed
@ -10,19 +10,19 @@
// enumerates at runtime -- USB hotplug is the obvious one -- this needs a
// spinlock, and the reader in procfs needs to take it.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "device.h"
#include "display.h"
#include "netdev.h"
#include "theme.h"
#include "text.h"
#include "spinlock.h"
#include "gfx.h"
#include "pci.h"
#include "mmu.h"
#include "memlayout.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "dev/device.h"
#include "gfx/display.h"
#include "dev/netdev.h"
#include "gfx/theme.h"
#include "gfx/text.h"
#include "core/spinlock.h"
#include "gfx/gfx.h"
#include "dev/pci.h"
#include "arch/mmu.h"
#include "arch/memlayout.h"
static struct device devices[NDEVICE];
static int ndevices;
@ -187,7 +187,7 @@ display_present(int x, int y, int w, int h)
// Where this display's pixels actually end up. 0 when the driver does not say,
// which callers must read as "assume it is the console's" -- see the comment
// on scanout_phys in include/display.h.
// on scanout_phys in include/gfx/display.h.
uint64
display_scanout_phys(void)
{
@ -229,7 +229,7 @@ display_wait_vblank(void)
//
// The second is the one worth having. It is also the one that only works
// because the userspace driver said in advance where it was scanning out --
// see PCIIOC_PANICFB in include/pciuser.h.
// see PCIIOC_PANICFB in include/dev/pciuser.h.
// Copy the console framebuffer into a surface, with the same rules vgpud's
// mirror uses: the overlap, centred if the surface is larger, top-left if it
@ -546,7 +546,7 @@ text_selftest(void)
}
// ---------------------------------------------------------------------------
// The network class. See include/netdev.h.
// The network class. See include/dev/netdev.h.
//
// Plural where the display class is singular: a machine with two NICs is
// ordinary, and "the network" is not a thing a stack can ask for the way a

View file

@ -21,16 +21,16 @@
// own copy. That is inherent to a raw device and not a defect -- but it is why
// an installer must target a disk it has not mounted.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "file.h"
#include "errno.h"
#include "blkdev.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "fs/blkdev.h"
// The byte offset is 64-bit, all the way from struct file's off through the
// devsw signature to bread's block number. It used to narrow to a 32-bit uint

View file

@ -13,11 +13,11 @@
// handed over by the UEFI loader from the configuration table, or found by the
// BIOS-era scan of 0xF0000-0xFFFFF when it was not.
#include "types.h"
#include "defs.h"
#include "memlayout.h"
#include "schboot.h"
#include "hwinfo.h"
#include "core/types.h"
#include "core/defs.h"
#include "arch/memlayout.h"
#include "arch/schboot.h"
#include "core/hwinfo.h"
static int tried;
static uint64 ep_pa; static uint32 ep_len;

View file

@ -11,19 +11,19 @@
// what makes the device inspectable from a shell, which is worth a great deal
// while there is no GUI yet to inspect it with.
#include "types.h"
#include "defs.h"
#include "gfx.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "fb.h"
#include "uaccess.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "gfx/gfx.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "gfx/fb.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
// Describe one colour channel. A channel that does not exist gets length 0,
// which is how callers are supposed to detect "no alpha" rather than by

View file

@ -1,4 +1,4 @@
// Drawing and the text console, on whatever display is bound. See include/gfx.h
// Drawing and the text console, on whatever display is bound. See include/gfx/gfx.h
// for why this is not a driver and does not name one.
//
// It was kernel/dev/vga.c, and the name was the problem: panic.c called
@ -11,20 +11,20 @@
// out of the boot block here. That is the whole of the inversion: a driver
// publishes what it owns, and this file draws on it without knowing what it is.
#include "types.h"
#include "x86.h"
#include "memlayout.h"
#include "defs.h"
#include "theme.h"
#include "logo.h"
#include "device.h"
#include "display.h"
#include "gfx.h"
#include "vt.h"
#include "text.h"
#include "schboot.h"
#include "ttf.h"
#include "vmap.h"
#include "core/types.h"
#include "arch/x86.h"
#include "arch/memlayout.h"
#include "core/defs.h"
#include "gfx/theme.h"
#include "gfx/logo.h"
#include "dev/device.h"
#include "gfx/display.h"
#include "gfx/gfx.h"
#include "dev/vt.h"
#include "gfx/text.h"
#include "arch/schboot.h"
#include "gfx/ttf.h"
#include "arch/vmap.h"
#define BACKSPACE 0x100
#define COLOR_BG SCH_BG

View file

@ -1,18 +1,18 @@
// Simple PIO-based (non-DMA) IDE driver code.
#include "types.h"
#include "defs.h"
#include "irq.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "x86.h"
#include "traps.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/irq.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/x86.h"
#include "arch/traps.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#define SECTOR_SIZE 512
#define IDE_BSY 0x80

View file

@ -9,17 +9,17 @@
// grabs the pointer and leaves the keyboard alone, or the other way round, and
// merging them into a single stream makes that impossible to express.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "input.h"
#include "errno.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "dev/input.h"
#include "uapi/errno.h"
#define NEVENT 256 // per device; ~10 seconds of frantic typing

View file

@ -1,12 +1,12 @@
// Hardware interrupt registration. See include/irq.h for why this exists.
// Hardware interrupt registration. See include/core/irq.h for why this exists.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "traps.h"
#include "spinlock.h"
#include "irq.h"
#include "x86.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/traps.h"
#include "core/spinlock.h"
#include "core/irq.h"
#include "arch/x86.h"
struct irq_action {
irq_handler_t fn;
@ -53,7 +53,7 @@ irq_init(void)
// vectors that xv6 numbered as though they were. The error vector used to be
// 19, which *is* a pin: one of the four an Intel chipset wires its PCI
// interrupts to, so a device there would have been refused. It is 30 now,
// above every pin; see include/traps.h.
// above every pin; see include/arch/traps.h.
static int
reserved(int irq)
{

View file

@ -1,16 +1,16 @@
#include "types.h"
#include "x86.h"
#include "defs.h"
#include "kbd.h"
#include "posix.h"
#include "vt.h" /* NVT -- how many terminals the chords reach */
#include "input.h"
#include "keymap.h"
#include "core/types.h"
#include "arch/x86.h"
#include "core/defs.h"
#include "dev/kbd.h"
#include "uapi/posix.h"
#include "dev/vt.h" /* NVT -- how many terminals the chords reach */
#include "dev/input.h"
#include "dev/keymap.h"
// The chord, settable at run time through VT_SETCHORD.
//
// AltGr+F1..F6 by default. Every other candidate is taken by the host, by
// applications, or by the keyboard layout -- see include/kbd.h -- and AltGr
// applications, or by the keyboard layout -- see include/dev/kbd.h -- and AltGr
// with a function key is taken by none of the three: a Polish layout wants
// AltGr+*letter*, which still reaches the shell untouched, and no window
// manager binds AltGr with an F-key.
@ -172,4 +172,4 @@ kbdintr(void)
// match, and the only symptom would be a key that does nothing.
_Static_assert(VTC_SHIFT == SHIFT && VTC_CTRL == CTL &&
VTC_ALT == ALT && VTC_RALT == RALT,
"include/posix.h VTC_* must mirror include/kbd.h modifiers");
"include/uapi/posix.h VTC_* must mirror include/dev/kbd.h modifiers");

View file

@ -1,4 +1,4 @@
// Keyboard layouts. See include/keymap.h for the interface and its limits.
// Keyboard layouts. See include/dev/keymap.h for the interface and its limits.
//
// Every table is indexed by set-1 scancode, with the E0-prefixed keys folded
// into 0x80..0xFF by kbd.c before the lookup -- the same numbering the single
@ -9,10 +9,10 @@
// exists: `ą` is U+0105 and does not fit in a byte, and a Polish layout that
// cannot type `ą` is not one.
#include "types.h"
#include "defs.h"
#include "kbd.h"
#include "keymap.h"
#include "core/types.h"
#include "core/defs.h"
#include "dev/kbd.h"
#include "dev/keymap.h"
// Shared by every layout that does not move the navigation block, which is
// all of them -- the arrow keys are not a national matter. Merged into each
@ -101,7 +101,7 @@ static const uint32 pl_shiftaltgr[256] = {
// keyboard does not have at all -- carries < > |.
//
// The acute (0x0D) and circumflex (0x29) keys are dead on a real German
// layout. Here they type the accent on its own. See include/keymap.h.
// layout. Here they type the accent on its own. See include/dev/keymap.h.
static const uint32 de_plain[256] = {
NO, 0x1B, '1', '2', '3', '4', '5', '6', // 0x00

View file

@ -1,13 +1,13 @@
#include "types.h"
#include "defs.h"
#include "gfx.h"
#include "irq.h"
#include "x86.h"
#include "traps.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "core/types.h"
#include "core/defs.h"
#include "gfx/gfx.h"
#include "core/irq.h"
#include "arch/x86.h"
#include "arch/traps.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#define KBD_S_STAT 0x64
#define KBD_S_DATA 0x60

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// /dev/netdev -- a network interface whose backend is a process.
// See include/netuser.h.
// See include/net/netuser.h.
//
// The shape is `/dev/pci`'s, deliberately, and for the same reasons. One
// device, one owner, claimed and released, and the kernel takes it back when
@ -13,23 +13,23 @@
// and the process is the driver, so the queues run the other way and the
// vtable is ours rather than theirs.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "errno.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "uaccess.h"
#include "device.h"
#include "netdev.h"
#include "sbuf.h"
#include "dbg.h"
#include "netuser.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "uapi/errno.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "core/uaccess.h"
#include "dev/device.h"
#include "dev/netdev.h"
#include "core/sbuf.h"
#include "core/dbg.h"
#include "net/netuser.h"
struct frame {
int len;

View file

@ -12,23 +12,23 @@
// not there, and it cannot tell you which bridge a device sits behind -- and
// that matters as soon as interrupt routing does.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "x86.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "pci.h"
#include "sbuf.h"
#include "dbg.h"
#include "device.h"
#include "traps.h"
#include "irq.h"
#include "acpi.h"
#include "memlayout.h"
#include "proc.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/x86.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "dev/pci.h"
#include "core/sbuf.h"
#include "core/dbg.h"
#include "dev/device.h"
#include "arch/traps.h"
#include "core/irq.h"
#include "dev/acpi.h"
#include "arch/memlayout.h"
#include "core/proc.h"
static struct pci_dev devs[NPCI];
static int ndevs;

View file

@ -2,7 +2,7 @@
//
// /dev/pci -- PCI devices, reachable from userspace.
//
// See include/pciuser.h for what this is and why the interface is about PCI
// See include/dev/pciuser.h for what this is and why the interface is about PCI
// rather than about drivers. This file is the kernel half: enumeration, the
// claim, the check that makes mmap safe, and DMA memory a device can be
// pointed at.
@ -14,24 +14,24 @@
// have been told to let go first -- which for now means "do not claim a device
// the kernel is driving", enforced below rather than assumed.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "ioperm.h"
#include "pci.h"
#include "errno.h"
#include "uaccess.h"
#include "irq.h"
#include "pciuser.h"
#include "sbuf.h"
#include "dbg.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/ioperm.h"
#include "dev/pci.h"
#include "uapi/errno.h"
#include "core/uaccess.h"
#include "core/irq.h"
#include "dev/pciuser.h"
#include "core/sbuf.h"
#include "core/dbg.h"
int mappages(pml4e_t *pgdir, void *va, uint64 size, uint64 pa, int perm);
// Who holds each device, or 0. Indexed the same way pci_get() is, because the
@ -50,7 +50,7 @@ static struct proc *owner[NPCI];
static const struct pci_driver *released_drv[NPCI];
// Where a userspace display driver is scanning out, so panic() can put the
// report there. See PCIIOC_PANICFB in include/pciuser.h.
// report there. See PCIIOC_PANICFB in include/dev/pciuser.h.
struct panicfb {
uint64 paddr;
uint32 width, height, stride;
@ -539,7 +539,7 @@ do_claim(uint64 argp)
// e1000's reset path issues `out` directly, because on an 82540 that is the
// only way the chip will acknowledge the write. So a process holding a
// device gets that device's I/O BARs and nothing else -- see
// include/ioperm.h. PCI_CMD_IO goes with them for the same reason memory
// include/arch/ioperm.h. PCI_CMD_IO goes with them for the same reason memory
// space goes with the mapping above.
{
int granted = 0;

View file

@ -15,33 +15,33 @@
// kernel/fs/procfs.c; this file only generates the *content* of the global
// files. `ps` and `top` work through the former.
#include "types.h"
#include "defs.h"
#include "klog.h"
#include "irq.h"
#include "x86.h"
#include "device.h"
#include "display.h"
#include "netdev.h"
#include "param.h"
#include "memlayout.h"
#include "hwinfo.h"
#include "mmu.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "file.h"
#include "proc.h"
#include "uaccess.h"
#include "errno.h"
#include "fsstat.h"
#include "schfs.h"
#include "sbuf.h"
#include "kmem.h"
#include "dbg.h"
#include "blkdev.h"
#include "fat.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/klog.h"
#include "core/irq.h"
#include "arch/x86.h"
#include "dev/device.h"
#include "gfx/display.h"
#include "dev/netdev.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "core/hwinfo.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#include "fs/file.h"
#include "core/proc.h"
#include "core/uaccess.h"
#include "uapi/errno.h"
#include "fs/fsstat.h"
#include "fs/schfs.h"
#include "core/sbuf.h"
#include "core/kmem.h"
#include "core/dbg.h"
#include "fs/blkdev.h"
#include "fs/fat.h"
// Every generated file is rendered whole into one buffer and then sliced, so
// this is the largest any of them can be. It was 2048, which a 24-processor
@ -73,7 +73,7 @@ proc_genbuf_put(void)
}
// The formatting helpers these files are built out of now live in
// include/sbuf.h, because the debugger's introspection registry needs exactly
// include/core/sbuf.h, because the debugger's introspection registry needs exactly
// the same thing and two copies would have drifted. See docs/architecture/debugging.md.
// --- the files -------------------------------------------------------------

View file

@ -15,15 +15,15 @@
// Enabled by building with RAMROOT=1. Without it this file still compiles, the
// device reports zero size, and the kernel boots from the IDE disk as before.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "buf.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "arch/memlayout.h"
#include "arch/mmu.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/buf.h"
#ifdef RAMDISK_ROOT
// Supplied by `ld -r -b binary` over build/fs-ram.img, renamed by objcopy.

View file

@ -1,19 +1,19 @@
// Text rendering. See include/text.h for what this replaces and why.
// Text rendering. See include/gfx/text.h for what this replaces and why.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "text.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "gfx/text.h"
// Included, now that this is the only file that reads it.
//
// It used to be `extern unsigned char font_data[256][16];` with a note
// explaining that include/font.h *defines* the array rather than declaring
// explaining that include/gfx/font.h *defines* the array rather than declaring
// it, so a second includer would break the link. The second includer was
// gfx.c, which walked the bitmap itself when there was no TrueType face --
// and that was the duplicate glyph path. With it gone, the header can live
// with its one user.
#include "font.h"
#include "gfx/font.h"
// --- UTF-8 -----------------------------------------------------------------

View file

@ -1,4 +1,4 @@
// TrueType outlines. See include/ttf.h for scope.
// TrueType outlines. See include/gfx/ttf.h for scope.
//
// Written from Apple's TrueType Reference Manual and the OpenType
// specification. Nothing here is derived from FreeType or stb_truetype.
@ -11,13 +11,13 @@ typedef unsigned short uint16;
typedef unsigned int uint32;
typedef signed short int16;
#else
#include "types.h"
#include "defs.h"
#include "param.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#endif
#include "text.h"
#include "ttf.h"
#include "gfx/text.h"
#include "gfx/ttf.h"
// Every multi-byte field in an sfnt file is big-endian, whatever the machine
// is. Read them byte by byte rather than casting: the file is not guaranteed

View file

@ -1,17 +1,17 @@
// Intel 8250 serial port (UART).
#include "types.h"
#include "defs.h"
#include "irq.h"
#include "param.h"
#include "traps.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "fs.h"
#include "file.h"
#include "mmu.h"
#include "proc.h"
#include "x86.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/irq.h"
#include "core/param.h"
#include "arch/traps.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "fs/fs.h"
#include "fs/file.h"
#include "arch/mmu.h"
#include "core/proc.h"
#include "arch/x86.h"
#define COM1 0x3f8

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
//
// Virtual terminals. See include/vt.h for why this exists at all; the short
// Virtual terminals. See include/dev/vt.h for why this exists at all; the short
// version is that switching needs a backing store, and the console drew
// straight into the framebuffer.
//
@ -11,15 +11,15 @@
// spreads "am I on screen" through the escape parser, and then a terminal
// that was switched away mid-sequence comes back wrong.
#include "types.h"
#include "defs.h"
#include "param.h"
#include "spinlock.h"
#include "sleeplock.h"
#include "posix.h"
#include "theme.h"
#include "gfx.h"
#include "vt.h"
#include "core/types.h"
#include "core/defs.h"
#include "core/param.h"
#include "core/spinlock.h"
#include "core/sleeplock.h"
#include "uapi/posix.h"
#include "gfx/theme.h"
#include "gfx/gfx.h"
#include "dev/vt.h"
int vt_active = 0;