diff options
| -rw-r--r-- | .clang-format (renamed from na/.clang-format) | 0 | ||||
| -rw-r--r-- | .clang-tidy (renamed from na/.clang-tidy) | 0 | ||||
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | Makefile | 458 | ||||
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | arch/riscv/config.cc (renamed from na/arch/riscv/config.cc) | 0 | ||||
| -rw-r--r-- | arch/riscv/defconfig (renamed from na/arch/riscv/defconfig) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/config.h (renamed from na/arch/riscv/include/arch/config.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/context.h (renamed from na/arch/riscv/include/arch/context.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/cpu.h (renamed from na/arch/riscv/include/arch/cpu.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/extable.h (renamed from na/arch/riscv/include/arch/extable.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/fpstate.h (renamed from na/arch/riscv/include/arch/fpstate.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/mmu.h (renamed from na/arch/riscv/include/arch/mmu.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/pmap.h (renamed from na/arch/riscv/include/arch/pmap.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/random.h (renamed from na/arch/riscv/include/arch/random.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/sbi.h (renamed from na/arch/riscv/include/arch/sbi.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/tlb.h (renamed from na/arch/riscv/include/arch/tlb.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/trap.h (renamed from na/arch/riscv/include/arch/trap.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/arch/trapframe.h (renamed from na/arch/riscv/include/arch/trapframe.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/asm/csr.h (renamed from na/arch/riscv/include/asm/csr.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/asm/page.h (renamed from na/arch/riscv/include/asm/page.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/asm/pgtable.h (renamed from na/arch/riscv/include/asm/pgtable.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/include/asm/sections.h (renamed from na/arch/riscv/include/asm/sections.h) | 0 | ||||
| -rw-r--r-- | arch/riscv/kernel/asm-offsets.c (renamed from na/arch/riscv/kernel/asm-offsets.c) | 0 | ||||
| -rw-r--r-- | arch/riscv/kernel/head.S (renamed from na/arch/riscv/kernel/head.S) | 0 | ||||
| -rw-r--r-- | arch/riscv/kernel/lumeos.lds.S (renamed from na/arch/riscv/kernel/lumeos.lds.S) | 0 | ||||
| -rw-r--r-- | arch/riscv/kernel/signal.cc (renamed from na/arch/riscv/kernel/signal.cc) | 0 | ||||
| -rw-r--r-- | arch/riscv/lib/random.cc (renamed from na/arch/riscv/lib/random.cc) | 0 | ||||
| -rw-r--r-- | arch/riscv/mm/init.cc (renamed from na/arch/riscv/mm/init.cc) | 0 | ||||
| -rw-r--r-- | arch/riscv/mm/pmap.cc (renamed from na/arch/riscv/mm/pmap.cc) | 0 | ||||
| -rw-r--r-- | arch/riscv/mm/tlb_md.cc (renamed from na/arch/riscv/mm/tlb_md.cc) | 0 | ||||
| -rw-r--r-- | arch/riscv/module.mk (renamed from na/arch/riscv/module.mk) | 0 | ||||
| -rw-r--r-- | arch/riscv/syscall/syscall_md.cc (renamed from na/arch/riscv/syscall/syscall_md.cc) | 0 | ||||
| -rw-r--r-- | arch/riscv/trap/extable.cc (renamed from na/arch/riscv/trap/extable.cc) | 0 | ||||
| -rw-r--r-- | arch/riscv/trap/fpu.S (renamed from na/arch/riscv/trap/fpu.S) | 0 | ||||
| -rw-r--r-- | arch/riscv/trap/swtch.S (renamed from na/arch/riscv/trap/swtch.S) | 0 | ||||
| -rw-r--r-- | arch/riscv/trap/trap_md.cc (renamed from na/arch/riscv/trap/trap_md.cc) | 0 | ||||
| -rw-r--r-- | arch/riscv/trap/trap_vector.S (renamed from na/arch/riscv/trap/trap_vector.S) | 0 | ||||
| -rw-r--r-- | arch/riscv/uaccess/uaccess_memcpy.S (renamed from na/arch/riscv/uaccess/uaccess_memcpy.S) | 0 | ||||
| -rw-r--r-- | drivers/base/bus.cc (renamed from na/drivers/base/bus.cc) | 0 | ||||
| -rw-r--r-- | drivers/base/core.cc (renamed from na/drivers/base/core.cc) | 0 | ||||
| -rw-r--r-- | drivers/base/driver.cc (renamed from na/drivers/base/driver.cc) | 0 | ||||
| -rw-r--r-- | drivers/base/module.mk (renamed from na/drivers/base/module.mk) | 0 | ||||
| -rw-r--r-- | drivers/base/platform.cc (renamed from na/drivers/base/platform.cc) | 0 | ||||
| -rw-r--r-- | drivers/console.cc (renamed from na/drivers/console.cc) | 0 | ||||
| -rw-r--r-- | drivers/module.mk (renamed from na/drivers/module.mk) | 0 | ||||
| -rw-r--r-- | drivers/plic.cc (renamed from na/drivers/plic.cc) | 0 | ||||
| -rw-r--r-- | drivers/tty/module.mk (renamed from na/drivers/tty/module.mk) | 0 | ||||
| -rw-r--r-- | drivers/tty/n_tty.cc (renamed from na/drivers/tty/n_tty.cc) | 0 | ||||
| -rw-r--r-- | drivers/tty/tty_core.cc (renamed from na/drivers/tty/tty_core.cc) | 0 | ||||
| -rw-r--r-- | drivers/tty/tty_uart.cc (renamed from na/drivers/tty/tty_uart.cc) | 0 | ||||
| -rw-r--r-- | drivers/uart.cc (renamed from na/drivers/uart.cc) | 0 | ||||
| -rw-r--r-- | fdt/device_node.cc (renamed from na/fdt/device_node.cc) | 0 | ||||
| -rw-r--r-- | fdt/fdt.cc (renamed from na/fdt/fdt.cc) | 0 | ||||
| -rw-r--r-- | fdt/module.mk (renamed from na/fdt/module.mk) | 0 | ||||
| -rw-r--r-- | fs/chardev.cc (renamed from na/fs/chardev.cc) | 0 | ||||
| -rw-r--r-- | fs/dcache.cc (renamed from na/fs/dcache.cc) | 0 | ||||
| -rw-r--r-- | fs/devfs.cc (renamed from na/fs/devfs.cc) | 0 | ||||
| -rw-r--r-- | fs/fd.cc (renamed from na/fs/fd.cc) | 0 | ||||
| -rw-r--r-- | fs/file_table.cc (renamed from na/fs/file_table.cc) | 0 | ||||
| -rw-r--r-- | fs/fs_struct.cc (renamed from na/fs/fs_struct.cc) | 0 | ||||
| -rw-r--r-- | fs/initramfs.cc (renamed from na/fs/initramfs.cc) | 0 | ||||
| -rw-r--r-- | fs/inode.cc (renamed from na/fs/inode.cc) | 0 | ||||
| -rw-r--r-- | fs/module.mk (renamed from na/fs/module.mk) | 0 | ||||
| -rw-r--r-- | fs/namei.cc (renamed from na/fs/namei.cc) | 0 | ||||
| -rw-r--r-- | fs/pipe.cc (renamed from na/fs/pipe.cc) | 0 | ||||
| -rw-r--r-- | fs/ramfs/file.cc (renamed from na/fs/ramfs/file.cc) | 0 | ||||
| -rw-r--r-- | fs/ramfs/inode.cc (renamed from na/fs/ramfs/inode.cc) | 0 | ||||
| -rw-r--r-- | fs/ramfs/super.cc (renamed from na/fs/ramfs/super.cc) | 0 | ||||
| -rw-r--r-- | fs/super.cc (renamed from na/fs/super.cc) | 0 | ||||
| -rw-r--r-- | fs/vfs_init.cc (renamed from na/fs/vfs_init.cc) | 0 | ||||
| -rw-r--r-- | include/libc-shim/bits/alltypes.h (renamed from na/include/libc-shim/bits/alltypes.h) | 0 | ||||
| -rw-r--r-- | include/libc-shim/endian.h (renamed from na/include/libc-shim/endian.h) | 0 | ||||
| -rw-r--r-- | include/libc-shim/features.h (renamed from na/include/libc-shim/features.h) | 0 | ||||
| -rw-r--r-- | include/libc-shim/limits.h (renamed from na/include/libc-shim/limits.h) | 0 | ||||
| -rw-r--r-- | include/libc-shim/stdint.h (renamed from na/include/libc-shim/stdint.h) | 0 | ||||
| -rw-r--r-- | include/libc-shim/string.h (renamed from na/include/libc-shim/string.h) | 0 | ||||
| -rw-r--r-- | include/libc-shim/strings.h (renamed from na/include/libc-shim/strings.h) | 0 | ||||
| -rw-r--r-- | include/lume/addr.h (renamed from na/include/lume/addr.h) | 0 | ||||
| -rw-r--r-- | include/lume/addr_types.h (renamed from na/include/lume/addr_types.h) | 0 | ||||
| -rw-r--r-- | include/lume/args.h (renamed from na/include/lume/args.h) | 0 | ||||
| -rw-r--r-- | include/lume/atomic.h (renamed from na/include/lume/atomic.h) | 0 | ||||
| -rw-r--r-- | include/lume/bitops.h (renamed from na/include/lume/bitops.h) | 0 | ||||
| -rw-r--r-- | include/lume/chardev.h (renamed from na/include/lume/chardev.h) | 0 | ||||
| -rw-r--r-- | include/lume/clone.h (renamed from na/include/lume/clone.h) | 0 | ||||
| -rw-r--r-- | include/lume/compiler.h (renamed from na/include/lume/compiler.h) | 0 | ||||
| -rw-r--r-- | include/lume/config.h (renamed from na/include/lume/config.h) | 0 | ||||
| -rw-r--r-- | include/lume/console.h (renamed from na/include/lume/console.h) | 0 | ||||
| -rw-r--r-- | include/lume/container_of.h (renamed from na/include/lume/container_of.h) | 0 | ||||
| -rw-r--r-- | include/lume/dcache.h (renamed from na/include/lume/dcache.h) | 0 | ||||
| -rw-r--r-- | include/lume/device.h (renamed from na/include/lume/device.h) | 0 | ||||
| -rw-r--r-- | include/lume/device_node.h (renamed from na/include/lume/device_node.h) | 0 | ||||
| -rw-r--r-- | include/lume/driver.h (renamed from na/include/lume/driver.h) | 0 | ||||
| -rw-r--r-- | include/lume/elf.h (renamed from na/include/lume/elf.h) | 0 | ||||
| -rw-r--r-- | include/lume/errno.h (renamed from na/include/lume/errno.h) | 0 | ||||
| -rw-r--r-- | include/lume/fdt.h (renamed from na/include/lume/fdt.h) | 0 | ||||
| -rw-r--r-- | include/lume/fdt_prop.h (renamed from na/include/lume/fdt_prop.h) | 0 | ||||
| -rw-r--r-- | include/lume/fdtable.h (renamed from na/include/lume/fdtable.h) | 0 | ||||
| -rw-r--r-- | include/lume/features.h (renamed from na/include/lume/features.h) | 0 | ||||
| -rw-r--r-- | include/lume/file.h (renamed from na/include/lume/file.h) | 0 | ||||
| -rw-r--r-- | include/lume/fs.h (renamed from na/include/lume/fs.h) | 0 | ||||
| -rw-r--r-- | include/lume/fs_struct.h (renamed from na/include/lume/fs_struct.h) | 0 | ||||
| -rw-r--r-- | include/lume/fs_types.h (renamed from na/include/lume/fs_types.h) | 0 | ||||
| -rw-r--r-- | include/lume/init.h (renamed from na/include/lume/init.h) | 0 | ||||
| -rw-r--r-- | include/lume/irq.h (renamed from na/include/lume/irq.h) | 0 | ||||
| -rw-r--r-- | include/lume/kbuild.h (renamed from na/include/lume/kbuild.h) | 0 | ||||
| -rw-r--r-- | include/lume/kernel_map.h (renamed from na/include/lume/kernel_map.h) | 0 | ||||
| -rw-r--r-- | include/lume/klog.h (renamed from na/include/lume/klog.h) | 0 | ||||
| -rw-r--r-- | include/lume/kobject.h (renamed from na/include/lume/kobject.h) | 0 | ||||
| -rw-r--r-- | include/lume/kprintf.h (renamed from na/include/lume/kprintf.h) | 0 | ||||
| -rw-r--r-- | include/lume/kref.h (renamed from na/include/lume/kref.h) | 0 | ||||
| -rw-r--r-- | include/lume/libfdt.h (renamed from na/include/lume/libfdt.h) | 0 | ||||
| -rw-r--r-- | include/lume/libfdt_env.h (renamed from na/include/lume/libfdt_env.h) | 0 | ||||
| -rw-r--r-- | include/lume/limits.h (renamed from na/include/lume/limits.h) | 0 | ||||
| -rw-r--r-- | include/lume/list.h (renamed from na/include/lume/list.h) | 0 | ||||
| -rw-r--r-- | include/lume/lumeos.lds.h (renamed from na/include/lume/lumeos.lds.h) | 0 | ||||
| -rw-r--r-- | include/lume/memblock.h (renamed from na/include/lume/memblock.h) | 0 | ||||
| -rw-r--r-- | include/lume/mm_layout.h (renamed from na/include/lume/mm_layout.h) | 0 | ||||
| -rw-r--r-- | include/lume/mman.h (renamed from na/include/lume/mman.h) | 0 | ||||
| -rw-r--r-- | include/lume/mount.h (renamed from na/include/lume/mount.h) | 0 | ||||
| -rw-r--r-- | include/lume/mutex.h (renamed from na/include/lume/mutex.h) | 0 | ||||
| -rw-r--r-- | include/lume/namei.h (renamed from na/include/lume/namei.h) | 0 | ||||
| -rw-r--r-- | include/lume/new.h (renamed from na/include/lume/new.h) | 0 | ||||
| -rw-r--r-- | include/lume/page.h (renamed from na/include/lume/page.h) | 0 | ||||
| -rw-r--r-- | include/lume/page_cache.h (renamed from na/include/lume/page_cache.h) | 0 | ||||
| -rw-r--r-- | include/lume/pgrp.h (renamed from na/include/lume/pgrp.h) | 0 | ||||
| -rw-r--r-- | include/lume/pgtable_types.h (renamed from na/include/lume/pgtable_types.h) | 0 | ||||
| -rw-r--r-- | include/lume/pid.h (renamed from na/include/lume/pid.h) | 0 | ||||
| -rw-r--r-- | include/lume/pipe.h (renamed from na/include/lume/pipe.h) | 0 | ||||
| -rw-r--r-- | include/lume/platform_device.h (renamed from na/include/lume/platform_device.h) | 0 | ||||
| -rw-r--r-- | include/lume/pmm.h (renamed from na/include/lume/pmm.h) | 0 | ||||
| -rw-r--r-- | include/lume/poll.h (renamed from na/include/lume/poll.h) | 0 | ||||
| -rw-r--r-- | include/lume/ptrace.h (renamed from na/include/lume/ptrace.h) | 0 | ||||
| -rw-r--r-- | include/lume/random.h (renamed from na/include/lume/random.h) | 0 | ||||
| -rw-r--r-- | include/lume/rbtree.h (renamed from na/include/lume/rbtree.h) | 0 | ||||
| -rw-r--r-- | include/lume/rbtree_augmented.h (renamed from na/include/lume/rbtree_augmented.h) | 0 | ||||
| -rw-r--r-- | include/lume/rbtree_types.h (renamed from na/include/lume/rbtree_types.h) | 0 | ||||
| -rw-r--r-- | include/lume/sched.h (renamed from na/include/lume/sched.h) | 0 | ||||
| -rw-r--r-- | include/lume/sched_class.h (renamed from na/include/lume/sched_class.h) | 0 | ||||
| -rw-r--r-- | include/lume/selftest.h (renamed from na/include/lume/selftest.h) | 0 | ||||
| -rw-r--r-- | include/lume/setup.h (renamed from na/include/lume/setup.h) | 0 | ||||
| -rw-r--r-- | include/lume/signal.h (renamed from na/include/lume/signal.h) | 0 | ||||
| -rw-r--r-- | include/lume/signal_nr.h (renamed from na/include/lume/signal_nr.h) | 0 | ||||
| -rw-r--r-- | include/lume/signal_types.h (renamed from na/include/lume/signal_types.h) | 0 | ||||
| -rw-r--r-- | include/lume/slab.h (renamed from na/include/lume/slab.h) | 0 | ||||
| -rw-r--r-- | include/lume/smp.h (renamed from na/include/lume/smp.h) | 0 | ||||
| -rw-r--r-- | include/lume/stdarg.h (renamed from na/include/lume/stdarg.h) | 0 | ||||
| -rw-r--r-- | include/lume/stringify.h (renamed from na/include/lume/stringify.h) | 0 | ||||
| -rw-r--r-- | include/lume/syscall.h (renamed from na/include/lume/syscall.h) | 0 | ||||
| -rw-r--r-- | include/lume/syscall_nr.h (renamed from na/include/lume/syscall_nr.h) | 0 | ||||
| -rw-r--r-- | include/lume/task.h (renamed from na/include/lume/task.h) | 0 | ||||
| -rw-r--r-- | include/lume/timer.h (renamed from na/include/lume/timer.h) | 0 | ||||
| -rw-r--r-- | include/lume/tlb.h (renamed from na/include/lume/tlb.h) | 0 | ||||
| -rw-r--r-- | include/lume/trap.h (renamed from na/include/lume/trap.h) | 0 | ||||
| -rw-r--r-- | include/lume/tty.h (renamed from na/include/lume/tty.h) | 0 | ||||
| -rw-r--r-- | include/lume/tty_ioctl.h (renamed from na/include/lume/tty_ioctl.h) | 0 | ||||
| -rw-r--r-- | include/lume/types.h (renamed from na/include/lume/types.h) | 0 | ||||
| -rw-r--r-- | include/lume/uaccess.h (renamed from na/include/lume/uaccess.h) | 0 | ||||
| -rw-r--r-- | include/lume/uuid.h (renamed from na/include/lume/uuid.h) | 0 | ||||
| -rw-r--r-- | include/lume/vmm.h (renamed from na/include/lume/vmm.h) | 0 | ||||
| -rw-r--r-- | include/lume/wait.h (renamed from na/include/lume/wait.h) | 0 | ||||
| -rw-r--r-- | include/lume/waitqueue.h (renamed from na/include/lume/waitqueue.h) | 0 | ||||
| -rw-r--r-- | kernel/exec.cc (renamed from na/kernel/exec.cc) | 0 | ||||
| -rw-r--r-- | kernel/irq.cc (renamed from na/kernel/irq.cc) | 0 | ||||
| -rw-r--r-- | kernel/main.cc (renamed from na/kernel/main.cc) | 0 | ||||
| -rw-r--r-- | kernel/module.mk (renamed from na/kernel/module.mk) | 0 | ||||
| -rw-r--r-- | kernel/pgrp.cc (renamed from na/kernel/pgrp.cc) | 0 | ||||
| -rw-r--r-- | kernel/pid.cc (renamed from na/kernel/pid.cc) | 0 | ||||
| -rw-r--r-- | kernel/poll.cc (renamed from na/kernel/poll.cc) | 0 | ||||
| -rw-r--r-- | kernel/ptrace.cc (renamed from na/kernel/ptrace.cc) | 0 | ||||
| -rw-r--r-- | kernel/sched_class_o1.cc (renamed from na/kernel/sched_class_o1.cc) | 0 | ||||
| -rw-r--r-- | kernel/sched_core.cc (renamed from na/kernel/sched_core.cc) | 0 | ||||
| -rw-r--r-- | kernel/sched_internal.h (renamed from na/kernel/sched_internal.h) | 0 | ||||
| -rw-r--r-- | kernel/signal.cc (renamed from na/kernel/signal.cc) | 0 | ||||
| -rw-r--r-- | kernel/smp.cc (renamed from na/kernel/smp.cc) | 0 | ||||
| -rw-r--r-- | kernel/sync/cpu_state.h (renamed from na/kernel/sync/cpu_state.h) | 0 | ||||
| -rw-r--r-- | kernel/sync/mutex.cc (renamed from na/kernel/sync/mutex.cc) | 0 | ||||
| -rw-r--r-- | kernel/sync/spinlock.cc (renamed from na/kernel/sync/spinlock.cc) | 0 | ||||
| -rw-r--r-- | kernel/sync/spinlock.h (renamed from na/kernel/sync/spinlock.h) | 0 | ||||
| -rw-r--r-- | kernel/sys_fs.cc (renamed from na/kernel/sys_fs.cc) | 0 | ||||
| -rw-r--r-- | kernel/sys_info.cc (renamed from na/kernel/sys_info.cc) | 0 | ||||
| -rw-r--r-- | kernel/sys_misc.cc (renamed from na/kernel/sys_misc.cc) | 0 | ||||
| -rw-r--r-- | kernel/sys_mm.cc (renamed from na/kernel/sys_mm.cc) | 0 | ||||
| -rw-r--r-- | kernel/sys_process.cc (renamed from na/kernel/sys_process.cc) | 0 | ||||
| -rw-r--r-- | kernel/sys_signal.cc (renamed from na/kernel/sys_signal.cc) | 0 | ||||
| -rw-r--r-- | kernel/syscall.cc (renamed from na/kernel/syscall.cc) | 0 | ||||
| -rw-r--r-- | kernel/task.cc (renamed from na/kernel/task.cc) | 0 | ||||
| -rw-r--r-- | kernel/timer.cc (renamed from na/kernel/timer.cc) | 0 | ||||
| -rw-r--r-- | kernel/trap.cc (renamed from na/kernel/trap.cc) | 0 | ||||
| -rw-r--r-- | kernel/uaccess.cc (renamed from na/kernel/uaccess.cc) | 0 | ||||
| -rw-r--r-- | kernel/waitqueue.cc (renamed from na/kernel/waitqueue.cc) | 0 | ||||
| -rw-r--r-- | lib/cxx_abi.cc (renamed from na/lib/cxx_abi.cc) | 0 | ||||
| -rw-r--r-- | lib/fdt.c (renamed from na/lib/fdt.c) | 0 | ||||
| -rw-r--r-- | lib/fdt_addresses.c (renamed from na/lib/fdt_addresses.c) | 0 | ||||
| -rw-r--r-- | lib/fdt_empty_tree.c (renamed from na/lib/fdt_empty_tree.c) | 0 | ||||
| -rw-r--r-- | lib/fdt_ro.c (renamed from na/lib/fdt_ro.c) | 0 | ||||
| -rw-r--r-- | lib/fdt_rw.c (renamed from na/lib/fdt_rw.c) | 0 | ||||
| -rw-r--r-- | lib/fdt_strerror.c (renamed from na/lib/fdt_strerror.c) | 0 | ||||
| -rw-r--r-- | lib/fdt_sw.c (renamed from na/lib/fdt_sw.c) | 0 | ||||
| -rw-r--r-- | lib/fdt_wip.c (renamed from na/lib/fdt_wip.c) | 0 | ||||
| -rw-r--r-- | lib/klog.cc (renamed from na/lib/klog.cc) | 0 | ||||
| -rw-r--r-- | lib/kobject.cc (renamed from na/lib/kobject.cc) | 0 | ||||
| -rw-r--r-- | lib/kprintf.cc (renamed from na/lib/kprintf.cc) | 0 | ||||
| -rw-r--r-- | lib/module.mk (renamed from na/lib/module.mk) | 0 | ||||
| -rw-r--r-- | lib/printf.c (renamed from na/lib/printf.c) | 0 | ||||
| -rw-r--r-- | lib/printf.h (renamed from na/lib/printf.h) | 0 | ||||
| -rw-r--r-- | lib/random.cc (renamed from na/lib/random.cc) | 0 | ||||
| -rw-r--r-- | lib/rbtree.cc (renamed from na/lib/rbtree.cc) | 0 | ||||
| -rw-r--r-- | lib/string/COPYRIGHT (renamed from na/lib/string/COPYRIGHT) | 0 | ||||
| -rw-r--r-- | lib/string/aarch64/memcpy.S (renamed from na/lib/string/aarch64/memcpy.S) | 0 | ||||
| -rw-r--r-- | lib/string/aarch64/memset.S (renamed from na/lib/string/aarch64/memset.S) | 0 | ||||
| -rw-r--r-- | lib/string/arm/__aeabi_memcpy.s (renamed from na/lib/string/arm/__aeabi_memcpy.s) | 0 | ||||
| -rw-r--r-- | lib/string/arm/__aeabi_memset.s (renamed from na/lib/string/arm/__aeabi_memset.s) | 0 | ||||
| -rw-r--r-- | lib/string/arm/memcpy.S (renamed from na/lib/string/arm/memcpy.S) | 0 | ||||
| -rw-r--r-- | lib/string/bcmp.c (renamed from na/lib/string/bcmp.c) | 0 | ||||
| -rw-r--r-- | lib/string/bcopy.c (renamed from na/lib/string/bcopy.c) | 0 | ||||
| -rw-r--r-- | lib/string/bzero.c (renamed from na/lib/string/bzero.c) | 0 | ||||
| -rw-r--r-- | lib/string/explicit_bzero.c (renamed from na/lib/string/explicit_bzero.c) | 0 | ||||
| -rw-r--r-- | lib/string/i386/memcpy.s (renamed from na/lib/string/i386/memcpy.s) | 0 | ||||
| -rw-r--r-- | lib/string/i386/memmove.s (renamed from na/lib/string/i386/memmove.s) | 0 | ||||
| -rw-r--r-- | lib/string/i386/memset.s (renamed from na/lib/string/i386/memset.s) | 0 | ||||
| -rw-r--r-- | lib/string/index.c (renamed from na/lib/string/index.c) | 0 | ||||
| -rw-r--r-- | lib/string/memccpy.c (renamed from na/lib/string/memccpy.c) | 0 | ||||
| -rw-r--r-- | lib/string/memchr.c (renamed from na/lib/string/memchr.c) | 0 | ||||
| -rw-r--r-- | lib/string/memcmp.c (renamed from na/lib/string/memcmp.c) | 0 | ||||
| -rw-r--r-- | lib/string/memcpy.c (renamed from na/lib/string/memcpy.c) | 0 | ||||
| -rw-r--r-- | lib/string/memmem.c (renamed from na/lib/string/memmem.c) | 0 | ||||
| -rw-r--r-- | lib/string/memmove.c (renamed from na/lib/string/memmove.c) | 0 | ||||
| -rw-r--r-- | lib/string/mempcpy.c (renamed from na/lib/string/mempcpy.c) | 0 | ||||
| -rw-r--r-- | lib/string/memrchr.c (renamed from na/lib/string/memrchr.c) | 0 | ||||
| -rw-r--r-- | lib/string/memset.c (renamed from na/lib/string/memset.c) | 0 | ||||
| -rw-r--r-- | lib/string/rindex.c (renamed from na/lib/string/rindex.c) | 0 | ||||
| -rw-r--r-- | lib/string/stpcpy.c (renamed from na/lib/string/stpcpy.c) | 0 | ||||
| -rw-r--r-- | lib/string/stpncpy.c (renamed from na/lib/string/stpncpy.c) | 0 | ||||
| -rw-r--r-- | lib/string/strcat.c (renamed from na/lib/string/strcat.c) | 0 | ||||
| -rw-r--r-- | lib/string/strchr.c (renamed from na/lib/string/strchr.c) | 0 | ||||
| -rw-r--r-- | lib/string/strchrnul.c (renamed from na/lib/string/strchrnul.c) | 0 | ||||
| -rw-r--r-- | lib/string/strcmp.c (renamed from na/lib/string/strcmp.c) | 0 | ||||
| -rw-r--r-- | lib/string/strcpy.c (renamed from na/lib/string/strcpy.c) | 0 | ||||
| -rw-r--r-- | lib/string/strcspn.c (renamed from na/lib/string/strcspn.c) | 0 | ||||
| -rw-r--r-- | lib/string/strlcat.c (renamed from na/lib/string/strlcat.c) | 0 | ||||
| -rw-r--r-- | lib/string/strlcpy.c (renamed from na/lib/string/strlcpy.c) | 0 | ||||
| -rw-r--r-- | lib/string/strlen.c (renamed from na/lib/string/strlen.c) | 0 | ||||
| -rw-r--r-- | lib/string/strncat.c (renamed from na/lib/string/strncat.c) | 0 | ||||
| -rw-r--r-- | lib/string/strncmp.c (renamed from na/lib/string/strncmp.c) | 0 | ||||
| -rw-r--r-- | lib/string/strncpy.c (renamed from na/lib/string/strncpy.c) | 0 | ||||
| -rw-r--r-- | lib/string/strnlen.c (renamed from na/lib/string/strnlen.c) | 0 | ||||
| -rw-r--r-- | lib/string/strpbrk.c (renamed from na/lib/string/strpbrk.c) | 0 | ||||
| -rw-r--r-- | lib/string/strrchr.c (renamed from na/lib/string/strrchr.c) | 0 | ||||
| -rw-r--r-- | lib/string/strsep.c (renamed from na/lib/string/strsep.c) | 0 | ||||
| -rw-r--r-- | lib/string/strspn.c (renamed from na/lib/string/strspn.c) | 0 | ||||
| -rw-r--r-- | lib/string/strstr.c (renamed from na/lib/string/strstr.c) | 0 | ||||
| -rw-r--r-- | lib/string/strtok.c (renamed from na/lib/string/strtok.c) | 0 | ||||
| -rw-r--r-- | lib/string/strtok_r.c (renamed from na/lib/string/strtok_r.c) | 0 | ||||
| -rw-r--r-- | lib/string/x86_64/memcpy.s (renamed from na/lib/string/x86_64/memcpy.s) | 0 | ||||
| -rw-r--r-- | lib/string/x86_64/memmove.s (renamed from na/lib/string/x86_64/memmove.s) | 0 | ||||
| -rw-r--r-- | lib/string/x86_64/memset.s (renamed from na/lib/string/x86_64/memset.s) | 0 | ||||
| -rw-r--r-- | lume-legacy/Makefile | 141 | ||||
| -rw-r--r-- | lume-legacy/include/common/fcntl.h (renamed from include/common/fcntl.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/common/types.h (renamed from include/common/types.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/drivers/plic.h (renamed from include/drivers/plic.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/drivers/uart.h (renamed from include/drivers/uart.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/drivers/uart_color.h (renamed from include/drivers/uart_color.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/drivers/virtio.h (renamed from include/drivers/virtio.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/fs/fat32.h (renamed from include/fs/fat32.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/fs/file.h (renamed from include/fs/file.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/fs/fs.h (renamed from include/fs/fs.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/fs/stat.h (renamed from include/fs/stat.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/buf.h (renamed from include/kernel/buf.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/config.h (renamed from include/kernel/config.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/cpu.h (renamed from include/kernel/cpu.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/elf.h (renamed from include/kernel/elf.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/exec.h (renamed from include/kernel/exec.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/fdt.h (renamed from include/kernel/fdt.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/mm.h (renamed from include/kernel/mm.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/pmm.h (renamed from include/kernel/pmm.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/proc.h (renamed from include/kernel/proc.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/proc_def.h (renamed from include/kernel/proc_def.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/riscv.h (renamed from include/kernel/riscv.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/runqueue.h (renamed from include/kernel/runqueue.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/sbi.h (renamed from include/kernel/sbi.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/slab.h (renamed from include/kernel/slab.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/spinlock.h (renamed from include/kernel/spinlock.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/sync.h (renamed from include/kernel/sync.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/syscall.h (renamed from include/kernel/syscall.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/timer.h (renamed from include/kernel/timer.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/kernel/trap.h (renamed from include/kernel/trap.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/lib/errno.h (renamed from include/lib/errno.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/lib/string.h (renamed from include/lib/string.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/assert.h (renamed from include/ulib/assert.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/cstdlib (renamed from include/ulib/cstdlib) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/cstring (renamed from include/ulib/cstring) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/ctypes.h (renamed from include/ulib/ctypes.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/cxx.cc (renamed from include/ulib/cxx.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/errno.h (renamed from include/ulib/errno.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/iostream (renamed from include/ulib/iostream) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/limits.h (renamed from include/ulib/limits.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/stb_sprintf.h (renamed from include/ulib/stb_sprintf.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/stdio.h (renamed from include/ulib/stdio.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/stdlib.h (renamed from include/ulib/stdlib.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/string.h (renamed from include/ulib/string.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/ulib/types.h (renamed from include/ulib/types.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/include/user/user.h (renamed from include/user/user.h) | 0 | ||||
| -rw-r--r-- | lume-legacy/linker.ld (renamed from linker.ld) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/boot/entry.S (renamed from src/boot/entry.S) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/drivers/plic.cc (renamed from src/drivers/plic.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/drivers/uart.cc (renamed from src/drivers/uart.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/drivers/virtio_dist.cc (renamed from src/drivers/virtio_dist.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/fs/fat32.cc (renamed from src/fs/fat32.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/fs/file.cc (renamed from src/fs/file.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/fs/fs.cc (renamed from src/fs/fs.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/bio.cc (renamed from src/kernel/bio.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/config.cc (renamed from src/kernel/config.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/cxx.cc (renamed from src/kernel/cxx.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/fdt.cc (renamed from src/kernel/fdt.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/initcode.S (renamed from src/kernel/initcode.S) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/main.cc (renamed from src/kernel/main.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/mm/pmm.cc (renamed from src/kernel/mm/pmm.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/mm/slab.cc (renamed from src/kernel/mm/slab.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/mm/vm.cc (renamed from src/kernel/mm/vm.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/proc/exec.cc (renamed from src/kernel/proc/exec.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/proc/proc.cc (renamed from src/kernel/proc/proc.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/proc/swtch.S (renamed from src/kernel/proc/swtch.S) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/sbi.cc (renamed from src/kernel/sbi.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/spinlock.cc (renamed from src/kernel/spinlock.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/syscall.cc (renamed from src/kernel/syscall.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/timer.cc (renamed from src/kernel/timer.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/trap/handler.cc (renamed from src/kernel/trap/handler.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/trap/trampoline.S (renamed from src/kernel/trap/trampoline.S) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/kernel/trap/trap.S (renamed from src/kernel/trap/trap.S) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/lib/string.cc (renamed from src/lib/string.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/ulib/assert.c (renamed from src/ulib/assert.c) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/ulib/cxx.cc (renamed from src/ulib/cxx.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/ulib/iostream.cpp (renamed from src/ulib/iostream.cpp) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/ulib/stdio.c (renamed from src/ulib/stdio.c) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/ulib/stdlib.c (renamed from src/ulib/stdlib.c) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/ulib/string.c (renamed from src/ulib/string.c) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/ulib/syscalls.c (renamed from src/ulib/syscalls.c) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/cat.cc (renamed from src/user/cat.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/cp.cc (renamed from src/user/cp.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/echo.cc (renamed from src/user/echo.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/entry.S (renamed from src/user/entry.S) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/grep.cc (renamed from src/user/grep.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/init.cc (renamed from src/user/init.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/kill.cc (renamed from src/user/kill.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/ln.cc (renamed from src/user/ln.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/ls.cc (renamed from src/user/ls.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/mkdir.cc (renamed from src/user/mkdir.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/mv.cc (renamed from src/user/mv.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/rm.cc (renamed from src/user/rm.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/sh.cc (renamed from src/user/sh.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/touch.cc (renamed from src/user/touch.cc) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/user.ld (renamed from src/user/user.ld) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/usys.S (renamed from src/user/usys.S) | 0 | ||||
| -rw-r--r-- | lume-legacy/src/user/wc.cc (renamed from src/user/wc.cc) | 0 | ||||
| -rw-r--r-- | mm/memblock.cc (renamed from na/mm/memblock.cc) | 0 | ||||
| -rw-r--r-- | mm/module.mk (renamed from na/mm/module.mk) | 0 | ||||
| -rw-r--r-- | mm/page_cache.cc (renamed from na/mm/page_cache.cc) | 0 | ||||
| -rw-r--r-- | mm/pmm.cc (renamed from na/mm/pmm.cc) | 0 | ||||
| -rw-r--r-- | mm/slab.cc (renamed from na/mm/slab.cc) | 0 | ||||
| -rw-r--r-- | mm/slab.h (renamed from na/mm/slab.h) | 0 | ||||
| -rw-r--r-- | mm/tlb.cc (renamed from na/mm/tlb.cc) | 0 | ||||
| -rw-r--r-- | mm/vma.cc (renamed from na/mm/vma.cc) | 0 | ||||
| -rw-r--r-- | mm/vmm.cc (renamed from na/mm/vmm.cc) | 0 | ||||
| -rw-r--r-- | na/Makefile | 419 | ||||
| -rw-r--r-- | scripts/Kbuild.include (renamed from na/scripts/Kbuild.include) | 0 | ||||
| -rw-r--r-- | scripts/Kconfig.mk (renamed from na/scripts/Kconfig.mk) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt.c (renamed from na/scripts/dtc/libfdt/fdt.c) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt.h (renamed from na/scripts/dtc/libfdt/fdt.h) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt_addresses.c (renamed from na/scripts/dtc/libfdt/fdt_addresses.c) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt_empty_tree.c (renamed from na/scripts/dtc/libfdt/fdt_empty_tree.c) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt_overlay.c (renamed from na/scripts/dtc/libfdt/fdt_overlay.c) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt_ro.c (renamed from na/scripts/dtc/libfdt/fdt_ro.c) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt_rw.c (renamed from na/scripts/dtc/libfdt/fdt_rw.c) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt_strerror.c (renamed from na/scripts/dtc/libfdt/fdt_strerror.c) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt_sw.c (renamed from na/scripts/dtc/libfdt/fdt_sw.c) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/fdt_wip.c (renamed from na/scripts/dtc/libfdt/fdt_wip.c) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/libfdt.h (renamed from na/scripts/dtc/libfdt/libfdt.h) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/libfdt_env.h (renamed from na/scripts/dtc/libfdt/libfdt_env.h) | 0 | ||||
| -rw-r--r-- | scripts/dtc/libfdt/libfdt_internal.h (renamed from na/scripts/dtc/libfdt/libfdt_internal.h) | 0 | ||||
| -rw-r--r-- | scripts/extract-asm-offsets.sed (renamed from na/scripts/extract-asm-offsets.sed) | 0 | ||||
| -rwxr-xr-x | scripts/gen_initramfs.sh (renamed from na/scripts/gen_initramfs.sh) | 0 | ||||
| -rw-r--r-- | test/module.mk (renamed from na/test/module.mk) | 0 | ||||
| -rw-r--r-- | test/selftest.cc (renamed from na/test/selftest.cc) | 0 | ||||
| -rw-r--r-- | test/test_atomic.cc (renamed from na/test/test_atomic.cc) | 0 | ||||
| -rw-r--r-- | test/test_dcache.cc (renamed from na/test/test_dcache.cc) | 0 | ||||
| -rw-r--r-- | test/test_driver_model.cc (renamed from na/test/test_driver_model.cc) | 0 | ||||
| -rw-r--r-- | test/test_exec.cc (renamed from na/test/test_exec.cc) | 0 | ||||
| -rw-r--r-- | test/test_fdt.cc (renamed from na/test/test_fdt.cc) | 0 | ||||
| -rw-r--r-- | test/test_klog.cc (renamed from na/test/test_klog.cc) | 0 | ||||
| -rw-r--r-- | test/test_mutex.cc (renamed from na/test/test_mutex.cc) | 0 | ||||
| -rw-r--r-- | test/test_namei.cc (renamed from na/test/test_namei.cc) | 0 | ||||
| -rw-r--r-- | test/test_page_cache.cc (renamed from na/test/test_page_cache.cc) | 0 | ||||
| -rw-r--r-- | test/test_pid.cc (renamed from na/test/test_pid.cc) | 0 | ||||
| -rw-r--r-- | test/test_pipe_devfs.cc (renamed from na/test/test_pipe_devfs.cc) | 0 | ||||
| -rw-r--r-- | test/test_pmm.cc (renamed from na/test/test_pmm.cc) | 0 | ||||
| -rw-r--r-- | test/test_random.cc (renamed from na/test/test_random.cc) | 0 | ||||
| -rw-r--r-- | test/test_rbtree.cc (renamed from na/test/test_rbtree.cc) | 0 | ||||
| -rw-r--r-- | test/test_sched.cc (renamed from na/test/test_sched.cc) | 0 | ||||
| -rw-r--r-- | test/test_signal.cc (renamed from na/test/test_signal.cc) | 0 | ||||
| -rw-r--r-- | test/test_slab.cc (renamed from na/test/test_slab.cc) | 0 | ||||
| -rw-r--r-- | test/test_smp.cc (renamed from na/test/test_smp.cc) | 0 | ||||
| -rw-r--r-- | test/test_spinlock.cc (renamed from na/test/test_spinlock.cc) | 0 | ||||
| -rw-r--r-- | test/test_sys_fs_extra.cc (renamed from na/test/test_sys_fs_extra.cc) | 0 | ||||
| -rw-r--r-- | test/test_sys_mm.cc (renamed from na/test/test_sys_mm.cc) | 0 | ||||
| -rw-r--r-- | test/test_sys_process.cc (renamed from na/test/test_sys_process.cc) | 0 | ||||
| -rw-r--r-- | test/test_trap.cc (renamed from na/test/test_trap.cc) | 0 | ||||
| -rw-r--r-- | test/test_uaccess.cc (renamed from na/test/test_uaccess.cc) | 0 | ||||
| -rw-r--r-- | test/test_vfs_io.cc (renamed from na/test/test_vfs_io.cc) | 0 | ||||
| -rw-r--r-- | test/test_vma.cc (renamed from na/test/test_vma.cc) | 0 | ||||
| -rw-r--r-- | test/test_vmm.cc (renamed from na/test/test_vmm.cc) | 0 | ||||
| -rw-r--r-- | test/test_waitqueue.cc (renamed from na/test/test_waitqueue.cc) | 0 | ||||
| -rw-r--r-- | usr/default_cpio_list (renamed from na/usr/default_cpio_list) | 0 | ||||
| -rw-r--r-- | usr/gen_init_cpio.c (renamed from na/usr/gen_init_cpio.c) | 0 |
414 files changed, 512 insertions, 512 deletions
diff --git a/na/.clang-format b/.clang-format index 141e1e2..141e1e2 100644 --- a/na/.clang-format +++ b/.clang-format diff --git a/na/.clang-tidy b/.clang-tidy index 1af2c5a..1af2c5a 100644 --- a/na/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ build/ -na/build/ +lume-legacy/build/ *.o *.d *.elf @@ -1,20 +1,81 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (C) 2026 Richard Qin +# +# LumeOS Kernel Makefile (Non-Recursive) +# +# Usage: +# make - Build kernel ELF +# make run - Run in QEMU +# make debug - Run in QEMU with GDB server +# make clean - Clean build artifacts +# make fmt - Format all source files +# make disasm - Generate disassembly listing +# +# Reference: docs/specs/00_conventions.md §7 -# Try to find a suitable RISC-V toolchain prefix +# ============================================================ +# Build Configuration +# ============================================================ +BUILD := build + +# Make sure `make` with no arguments builds the kernel image, not the +# first rule encountered during makefile parsing. scripts/Kconfig.mk +# (included next) defines `defconfig:` at the top of its rule list, +# which would otherwise become the default goal and silently overwrite +# .config from arch/$(ARCH)/defconfig. +.DEFAULT_GOAL := all + +# Load Kbuild helpers (Q, $(call cmd,...), quiet_cmd_* / cmd_* templates, +# kbuild-objs translator). Must come before Kconfig.mk so subsequent +# rules can use $(call cmd,...) immediately. +include scripts/Kbuild.include + +# Load Kconfig infrastructure (reads .config, sets KCPPFLAGS) +include scripts/Kconfig.mk + +ARCH ?= $(CONFIG_ARCH) + +# Two boot products — same pair as Linux RISC-V's arch/riscv/boot/Makefile +# (vmlinux + Image), but named LumeOS-style: +# VMLUME -> build/vmlume.elf : ELF with .symtab/PT_DYNAMIC/.rela.dyn +# IMAGE -> build/vmlume.bin : raw binary (objcopy -O binary) +VMLUME := $(BUILD)/vmlume.elf +IMAGE := $(BUILD)/vmlume.bin + +# Initramfs paths +INITRAMFS_DIR := $(BUILD)/initramfs +INITRAMFS_CPIO := $(BUILD)/initramfs.cpio +INITRAMFS_OBJ := $(BUILD)/initramfs.o +USR_INIT_ELF := $(BUILD)/usr/init +# Relocations: linker emits .rela.dyn under -shared -Bsymbolic; boot +# code in arch/riscv/mm/init.cc::relocate_kernel walks it at startup. +LDS_SRC := arch/$(ARCH)/kernel/lumeos.lds.S +LINKER_SCRIPT := $(BUILD)/lumeos.lds +PYTHON ?= python3 + +# ============================================================ +# Toolchain Detection +# ============================================================ ifndef TOOLCHAIN_PREFIX +ifeq ($(ARCH),riscv) + # Prefer the linux-gnu toolchain — it supports -shared / -pie which + # are required to emit .rela.dyn (Linux RISC-V kernel uses the same). + # The bare-metal `riscv64-unknown-elf-` is kept only as a last-resort + # fallback; with that one, `-shared` fails ("not supported") and the + # kernel can't relocate at runtime. TOOLCHAIN_PREFIX := $(shell \ - if command -v riscv64-linux-gnu-gcc >/dev/null 2>&1; then \ - echo riscv64-linux-gnu-; \ - elif command -v riscv64-unknown-gnu-gcc >/dev/null 2>&1; then \ - echo riscv64-unknown-gnu-; \ - elif command -v riscv64-unknown-linux-gnu-gcc >/dev/null 2>&1; then \ + if command -v riscv64-unknown-linux-gnu-g++ >/dev/null 2>&1; then \ echo riscv64-unknown-linux-gnu-; \ - elif command -v riscv64-unknown-elf-gcc >/dev/null 2>&1; then \ - echo riscv64-unknown-elf-; \ - else \ + elif command -v riscv64-linux-gnu-g++ >/dev/null 2>&1; then \ echo riscv64-linux-gnu-; \ + else \ + echo riscv64-unknown-linux-gnu-; \ fi) +else ifeq ($(ARCH),aarch64) + TOOLCHAIN_PREFIX := aarch64-linux-gnu- +else ifeq ($(ARCH),x86_64) + TOOLCHAIN_PREFIX := x86_64-linux-gnu- +endif endif CC := $(TOOLCHAIN_PREFIX)gcc @@ -22,120 +83,337 @@ CXX := $(TOOLCHAIN_PREFIX)g++ LD := $(TOOLCHAIN_PREFIX)ld OBJCOPY := $(TOOLCHAIN_PREFIX)objcopy OBJDUMP := $(TOOLCHAIN_PREFIX)objdump +# Objcopy output formats for binary-to-ELF relocation blob +OBJCOPY_ELF_riscv := elf64-littleriscv +OBJCOPY_ELF_aarch64 := elf64-littleaarch64 +OBJCOPY_ELF_x86_64 := elf64-x86-64 +OBJCOPY_ELF := $(OBJCOPY_ELF_$(ARCH)) -BUILD_DIR := build -SRC_DIR := src +OBJCOPY_BINARCH_riscv := riscv +OBJCOPY_BINARCH_aarch64 := aarch64 +OBJCOPY_BINARCH_x86_64 := i386:x86-64 +OBJCOPY_BINARCH := $(OBJCOPY_BINARCH_$(ARCH)) -CFLAGS := -Wall -Wextra -O2 -g -ffreestanding -nostdlib -mcmodel=medany -Iinclude -CXXFLAGS := $(CFLAGS) -fno-exceptions -fno-rtti -fno-use-cxa-atexit -LINKER_SCRIPT := linker.ld +# Common flags (base, before module includes) +WARNINGS := -Wall -Wextra -Wno-unused-parameter +INCLUDES := -Iinclude -I. -USER_LD := $(SRC_DIR)/user/user.ld -ULIB_OBJS := $(BUILD_DIR)/user/entry.o \ - $(BUILD_DIR)/user/usys.o \ - $(BUILD_DIR)/ulib/stdio.o \ - $(BUILD_DIR)/ulib/stdlib.o \ - $(BUILD_DIR)/ulib/string.o \ - $(BUILD_DIR)/ulib/cxx.o \ - $(BUILD_DIR)/ulib/iostream.o \ - $(BUILD_DIR)/ulib/syscalls.o +# ============================================================ +# Source Collection (Non-Recursive Module Fragments) +# Module .mk files may append to SRCS_CC, SRCS_S, INCLUDES +# ============================================================ +SRCS_CC := +SRCS_C := +SRCS_S := +SRCS_s := -INITCODE_BIN := $(BUILD_DIR)/user/initcode +-include arch/$(ARCH)/module.mk +include kernel/module.mk +include mm/module.mk +include fs/module.mk +include drivers/base/module.mk +include drivers/module.mk +include drivers/tty/module.mk +include fdt/module.mk +include lib/module.mk +include test/module.mk +# Compiler flags (defined AFTER includes so INCLUDES is complete) +CFLAGS := $(WARNINGS) -O2 -g \ + -ffreestanding -nostdlib \ + -mcmodel=medany \ + -fPIE \ + -MMD -MP \ + $(KCPPFLAGS) \ + $(INCLUDES) \ + -I$(BUILD)/generated -USER_SRCS := $(wildcard $(SRC_DIR)/user/*.cc) -UPROGS := $(patsubst $(SRC_DIR)/user/%.cc, $(BUILD_DIR)/user/%, $(USER_SRCS)) +# -fPIE makes the compiler emit position-independent code (PC-relative +# addressing + GOT for globals), which is what `-shared` linking expects. +# Mirrors Linux's arch/riscv/Makefile under CONFIG_RELOCATABLE=y: +# KBUILD_CFLAGS += -fPIE -SRCS_S := $(shell find $(SRC_DIR) -name "*.S" -not -path "$(SRC_DIR)/user/*" -not -path "$(SRC_DIR)/ulib/*") -SRCS_CXX := $(shell find $(SRC_DIR) -name "*.cc" -not -path "$(SRC_DIR)/user/*" -not -path "$(SRC_DIR)/ulib/*") -OBJS := $(SRCS_S:%.S=$(BUILD_DIR)/%.o) $(SRCS_CXX:%.cc=$(BUILD_DIR)/%.o) +# C flags for musl libc sources: add libc-shim headers first +CFLAGS_LIBC := $(CFLAGS) -Iinclude/libc-shim \ + -Wno-parentheses -Wno-sign-compare -TARGET := $(BUILD_DIR)/kernel.elf +CXXFLAGS := $(CFLAGS) \ + -std=c++17 \ + -fno-exceptions -fno-rtti -fno-use-cxa-atexit \ + -fno-threadsafe-statics -QEMUOPTS = -drive file=fs.img,if=none,format=raw,id=x0 -QEMUOPTS += -device virtio-blk-device,drive=x0 -global virtio-mmio.force-legacy=false +# Assembler flags MUST NOT include -fPIE. +# Linux's arch/riscv/Makefile adds -fPIE only to KBUILD_CFLAGS, NOT to +# KBUILD_AFLAGS: with -fPIE the gcc driver puts the assembler in PIC +# mode, where the `la` macro silently expands to a GOT-indirect load +# (`auipc + ld` reading a slot that holds the link-time VA). In our +# pre-MMU boot path that VA is unmapped, so any `la sym, sym` faults +# and reboots into a `_start` loop. Stripping -fPIE makes `la` emit +# direct PC-relative addressing (`auipc + addi`) which works at PA. +ASFLAGS := $(filter-out -fPIE,$(CFLAGS)) -.PHONY: all clean run debug +# Link as a position-independent shared object so the linker emits +# `.rela.dyn` with R_RISCV_RELATIVE entries that the boot stub applies +# at load time. Mirrors Linux's arch/riscv/Makefile §10: +# LDFLAGS_vmlinux += -shared -Bsymbolic -z notext +# `-Bsymbolic` resolves all global refs at link time (no dynamic +# resolution); `-z notext` lets us keep relocations in code pages. +LDFLAGS := -nostdlib -shared -Bsymbolic -z notext -z norelro --no-dynamic-linker -all: $(TARGET) $(INITCODE_BIN) $(UPROGS) fs.img +# ============================================================ +# Object File Computation +# ============================================================ +OBJS := $(patsubst %.cc,$(BUILD)/%.o,$(SRCS_CC)) \ + $(patsubst %.c,$(BUILD)/%.o,$(SRCS_C)) \ + $(patsubst %.S,$(BUILD)/%.o,$(SRCS_S)) \ + $(patsubst %.s,$(BUILD)/%.o,$(SRCS_s)) +DEPS := $(OBJS:.o=.d) -$(BUILD_DIR)/ulib/%.o: $(SRC_DIR)/ulib/%.c - @mkdir -p $(dir $@) - @echo " ULIB_C $<" - @$(CC) $(CFLAGS) -c $< -o $@ +# ============================================================ +# Build Rules +# ============================================================ +.PHONY: all clean run debug fmt disasm defconfig savedefconfig showconfig -$(BUILD_DIR)/ulib/%.o: $(SRC_DIR)/ulib/%.cc - @mkdir -p $(dir $@) - @echo " ULIB_CC $<" - @$(CXX) $(CXXFLAGS) -c $< -o $@ +all: $(VMLUME) $(IMAGE) + +# Generate autoconf.h before any compilation +$(AUTOCONF_H): scripts/Kconfig.mk $(wildcard .config) + $(generate-autoconf) -$(BUILD_DIR)/ulib/%.o: $(SRC_DIR)/ulib/%.cpp +# ============================================================ +# Generated header: asm-offsets.h +# +# Linux-style trick (mirrors include/linux/kbuild.h + arch/*/kernel/ +# asm-offsets.c + scripts/Makefile.build): compile asm-offsets.c to +# assembly, scrape the magic `->SYM val` markers produced by the +# DEFINE/OFFSET inline-asm macros, rewrite them into `#define` +# directives via sed. head.S and friends then `#include +# <generated/asm-offsets.h>` to access struct field offsets without +# having to hand-maintain them — re-order a struct field, the +# generated constant follows. +# ============================================================ +ASM_OFFSETS_C := arch/$(ARCH)/kernel/asm-offsets.c +ASM_OFFSETS_S := $(BUILD)/arch/$(ARCH)/kernel/asm-offsets.s +ASM_OFFSETS_H := $(BUILD)/generated/asm-offsets.h +ASM_OFFSETS_SED := scripts/extract-asm-offsets.sed + +# Compile asm-offsets.c to *.s only — we never want the .o linked in. +$(ASM_OFFSETS_S): $(ASM_OFFSETS_C) $(AUTOCONF_H) + @echo " CC -S $<" @mkdir -p $(dir $@) - @echo " ULIB_CPP $<" - @$(CXX) $(CXXFLAGS) -c $< -o $@ + @$(CC) $(CFLAGS_LIBC) -S $< -o $@ -$(BUILD_DIR)/user/%.o: $(SRC_DIR)/user/%.cc +# Rewrite ->NAME markers into #define lines. Header guard hand-rolled +# at the top, sed body in the middle, closing #endif at the bottom. +$(ASM_OFFSETS_H): $(ASM_OFFSETS_S) $(ASM_OFFSETS_SED) + @echo " GEN $@" @mkdir -p $(dir $@) - @echo " USER_CC $<" - @$(CXX) $(CXXFLAGS) -c $< -o $@ + @(echo "/* AUTO-GENERATED — DO NOT EDIT */"; \ + echo "/* Generated from $(ASM_OFFSETS_C) by scripts/extract-asm-offsets.sed */"; \ + echo "#ifndef _LUME_GENERATED_ASM_OFFSETS_H"; \ + echo "#define _LUME_GENERATED_ASM_OFFSETS_H"; \ + echo ""; \ + sed -n -f $(ASM_OFFSETS_SED) $<; \ + echo ""; \ + echo "#endif /* _LUME_GENERATED_ASM_OFFSETS_H */") > $@ + +# All objects depend on autoconf.h and asm-offsets.h +$(OBJS): $(AUTOCONF_H) $(ASM_OFFSETS_H) -$(BUILD_DIR)/user/%.o: $(SRC_DIR)/user/%.S +# ============================================================ +# Generic %.pi.o post-processing rule +# +# Mirrors arch/riscv/kernel/pi/Makefile §26-30 in Linux: +# +# $(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ +# --remove-section=.note.gnu.property +# --prefix-alloc-sections=.init.pi +# $(obj)/%.pi.o: $(obj)/%.o FORCE +# $(call if_changed,objcopy) +# +# Purpose: take a regular .o produced by the normal compile rule and +# rewrite it so the early position-independent code can coexist with +# the rest of the kernel without symbol clashes: +# +# --prefix-symbols=__pi_ Every global symbol becomes __pi_<name>. +# head.S calls them as __pi_fdt_path_offset +# etc., keeping the pre-MMU namespace +# cleanly isolated. +# +# --prefix-alloc-sections=.init.pi +# All SHF_ALLOC sections get re-prefixed +# so they land in .init.pi in vmlinux.lds.S, +# which positions them where the boot +# loader has already mapped memory. +# +# --remove-section=.note.gnu.property +# Discarded because post-rename it can +# confuse the linker about ELF features. +# +# Generic pattern (`$(BUILD)/%.pi.o`) so any subdir's source can opt in +# by listing a `.pi.o` target in its SRCS. The companion compile-side +# CFLAGS overrides (replacing -fPIE with -fpie, adding -Os, etc.) are +# expected to come from the subdir's own .mk fragment via target- +# specific CFLAGS_LIBC / CXXFLAGS overrides. +# ============================================================ +$(BUILD)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \ + --remove-section=.note.gnu.property \ + --prefix-alloc-sections=.init.pi + +$(BUILD)/%.pi.o: $(BUILD)/%.o + $(call cmd,objcopy) + +# Preprocess linker script template (.lds.S → .lds) +$(LINKER_SCRIPT): $(LDS_SRC) include/lume/lumeos.lds.h + @echo " LDS $@" @mkdir -p $(dir $@) - @echo " USER_AS $<" - @$(CC) $(CFLAGS) -c $< -o $@ + @$(CC) -E -P -x c $(INCLUDES) $< -o $@ -$(INITCODE_BIN): $(BUILD_DIR)/user/init.o $(ULIB_OBJS) $(USER_LD) - @echo " U_LD $@" - @$(LD) -T $(USER_LD) -o $@.out $(BUILD_DIR)/user/init.o $(ULIB_OBJS) - @$(OBJCOPY) -S -O binary $@.out $@ - @$(OBJDUMP) -S $@.out > $@.asm +# ============================================================ +# Initramfs: pack a root filesystem into a newc cpio. +# +# Pipeline mirrors Linux's Kbuild: +# usr/gen_init_cpio — host C tool, produces cpio bytes +# scripts/gen_initramfs.sh — wrapper that prepares the listing, +# handles directories vs. listing files, +# applies uid/gid remap, then invokes the +# host tool. +# Sourced from $(CONFIG_INITRAMFS_SOURCE) — see scripts/Kconfig.mk. +# ============================================================ +# Host compiler — distinct from $(CC), which may be the cross compiler. +HOSTCC ?= cc +HOSTCFLAGS ?= -O2 -Wall -$(BUILD_DIR)/user/%: $(BUILD_DIR)/user/%.o $(ULIB_OBJS) $(USER_LD) - @echo " USER_LD $@" - @$(LD) -T $(USER_LD) -o $@ $< $(ULIB_OBJS) - @$(OBJDUMP) -S $@ > $@.asm - @$(OBJDUMP) -t $@ | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > $@.sym +# Output path matches Linux convention (usr/gen_init_cpio) so the +# verbatim copy of scripts/gen_initramfs.sh from Linux finds it via its +# hardcoded relative path when invoked from the kernel source root. +GEN_INIT_CPIO := usr/gen_init_cpio +$(GEN_INIT_CPIO): usr/gen_init_cpio.c + @echo " HOSTCC $@" + @$(HOSTCC) $(HOSTCFLAGS) -o $@ $< -$(TARGET): $(OBJS) $(LINKER_SCRIPT) - @echo " K_LD $@" - @$(LD) -T $(LINKER_SCRIPT) -o $@ $(OBJS) - @echo " K_ASM $@.asm" - @$(OBJDUMP) -S $@ > $@.asm - @$(OBJDUMP) -t $@ | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > $@.sym +INITRAMFS_SOURCE := $(CONFIG_INITRAMFS_SOURCE) -$(BUILD_DIR)/src/kernel/initcode.o: $(SRC_DIR)/kernel/initcode.S $(INITCODE_BIN) - @mkdir -p $(dir $@) - @echo " AS_INC $<" - @$(CC) $(CFLAGS) -c $< -o $@ +# Record the chosen source so changing CONFIG_INITRAMFS_SOURCE on the +# command line forces a rebuild — without this, `make` only compares +# file mtimes and would happily reuse a cpio packed from a different +# source as long as that other source isn't newer. Evaluated at +# Makefile parse time so the dep edge is correct from the first rule +# check. Mirrors the idea behind Linux's $(call if_changed,...). +INITRAMFS_SRC_STAMP := $(BUILD)/.initramfs_src.stamp +$(shell mkdir -p $(BUILD) 2>/dev/null; \ + prev=$$([ -f "$(INITRAMFS_SRC_STAMP)" ] && cat "$(INITRAMFS_SRC_STAMP)" || echo); \ + if [ "$$prev" != "$(INITRAMFS_SOURCE)" ]; then \ + printf '%s\n' "$(INITRAMFS_SOURCE)" > "$(INITRAMFS_SRC_STAMP)"; \ + fi) -$(BUILD_DIR)/%.o: %.S +$(INITRAMFS_CPIO): $(INITRAMFS_SOURCE) $(INITRAMFS_SRC_STAMP) \ + $(GEN_INIT_CPIO) scripts/gen_initramfs.sh + @echo " INITRAMFS $(INITRAMFS_SOURCE)" @mkdir -p $(dir $@) - @echo " K_AS $<" - @$(CC) $(CFLAGS) -c $< -o $@ + @./scripts/gen_initramfs.sh -o $@ \ + -u $(CONFIG_INITRAMFS_ROOT_UID) \ + -g $(CONFIG_INITRAMFS_ROOT_GID) \ + $(INITRAMFS_SOURCE) -$(BUILD_DIR)/%.o: %.cc +$(INITRAMFS_OBJ): $(INITRAMFS_CPIO) + @echo " OBJCOPY $@ (initramfs)" + @$(OBJCOPY) -I binary -O $(OBJCOPY_ELF) -B $(OBJCOPY_BINARCH) \ + --rename-section .data=.init.ramfs,alloc,load,readonly,data,contents \ + $< $@ + +# Single-pass kernel link. With `-shared -Bsymbolic`, the linker +# emits `.rela.dyn` containing R_RISCV_RELATIVE entries directly into +# the output ELF — no separate gen_reloc pass. +$(VMLUME): $(OBJS) $(INITRAMFS_OBJ) $(LINKER_SCRIPT) + @echo " LD $@" @mkdir -p $(dir $@) - @echo " K_CXX $<" - @$(CXX) $(CXXFLAGS) -c $< -o $@ + @$(LD) $(LDFLAGS) -T $(LINKER_SCRIPT) -o $@ $(OBJS) $(INITRAMFS_OBJ) + @$(TOOLCHAIN_PREFIX)size $@ + +# Image = raw binary, mirrors Linux's `arch/riscv/boot/Image` (objcopy +# vmlinux to raw bytes, no ELF header — what U-Boot or QEMU's `-bios` +# bare-loading would consume). Linux always builds both vmlinux and +# Image; LumeOS follows the same convention. +$(IMAGE): $(VMLUME) + @echo " OBJCOPY $@" + @$(OBJCOPY) -O binary $< $@ + +# Compile C++ sources. Recipe goes through $(call cmd,...) so that +# `make V=1` echoes the full command line. $(Q) prefix on mkdir keeps +# the directory-creation step silent in quiet mode but visible at V=1. +$(BUILD)/%.o: %.cc + $(Q)mkdir -p $(dir $@) + $(call cmd,cxx_o_cc) + +$(BUILD)/%.o: %.c + $(Q)mkdir -p $(dir $@) + $(call cmd,cc_o_c) -fs.img: $(UPROGS) - @echo " IMG Generating fs.img (FAT32)" - @dd if=/dev/zero of=fs.img bs=1M count=32 2>/dev/null - @mkfs.vfat -F 32 fs.img >/dev/null - $(foreach prog,$(UPROGS),mcopy -i fs.img $(prog) ::/$(notdir $(prog));) +$(BUILD)/%.o: %.S + $(Q)mkdir -p $(dir $@) + $(call cmd,as_o_S) -run: $(TARGET) fs.img +$(BUILD)/%.o: %.s + $(Q)mkdir -p $(dir $@) + $(call cmd,as_o_S) + +# Auto-dependency tracking +-include $(DEPS) + +# ============================================================ +# Run & Debug +# ============================================================ +ifeq ($(ARCH),riscv) +QEMU := qemu-system-riscv64 +QEMU_MACHINE := -machine virt -smp 4 -m 128M -nographic +QEMU_BIOS := -bios default +else ifeq ($(ARCH),aarch64) +QEMU := qemu-system-aarch64 +QEMU_MACHINE := -machine virt -cpu cortex-a53 -m 128M -nographic +QEMU_BIOS := +else ifeq ($(ARCH),x86_64) +QEMU := qemu-system-x86_64 +QEMU_MACHINE := -m 128M -nographic +QEMU_BIOS := +endif + +run: $(VMLUME) $(IMAGE) @echo " QEMU Running..." - @qemu-system-riscv64 -machine virt -nographic \ - -kernel $(TARGET) -m 128M $(QEMUOPTS) + $(QEMU) $(QEMU_MACHINE) $(QEMU_BIOS) -kernel $(VMLUME) -debug: $(TARGET) fs.img - @echo " QEMU (DEBUG) Waiting for GDB..." - @qemu-system-riscv64 -machine virt -nographic \ - -kernel $(TARGET) -m 128M -s -S $(QEMUOPTS) +debug: $(VMLUME) $(IMAGE) + @echo " QEMU Waiting for GDB on :1234..." + $(QEMU) $(QEMU_MACHINE) $(QEMU_BIOS) -kernel $(VMLUME) -s -S +# ============================================================ +# Utilities +# ============================================================ clean: - rm -rf $(BUILD_DIR) fs.img
\ No newline at end of file + rm -rf $(BUILD) + +disasm: $(VMLUME) + @echo " OBJDUMP $<" + @$(OBJDUMP) -d -S $(VMLUME) > $(VMLUME).asm + @echo " Written to $(VMLUME).asm" + +fmt: + @echo " FMT Formatting source files..." + @find . -name '*.cc' -o -name '*.h' | xargs clang-format -i 2>/dev/null || true + +lint: + @echo " LINT Generating compile_commands.json via bear..." + @bear -- $(MAKE) all + @echo " LINT Running clang-tidy on C++ sources..." + @clang-tidy -p . $(SRCS_CC) || true + +# Print build info (for debugging Makefile issues) +info: + @echo "TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX)" + @echo "SRCS_CC = $(SRCS_CC)" + @echo "SRCS_S = $(SRCS_S)" + @echo "OBJS = $(OBJS)" + @echo "KCPPFLAGS = $(KCPPFLAGS)" @@ -7,7 +7,7 @@ Lume OS is a 64-bit monolithic operating system kernel written in C++ for the RI ## Note After studying for a period of time, I have roughly understood the design of some modern operating systems such as Windows, Linux, and BSD. I decided to refactor this operating system to make its architecture clear, scalable, and portable. My goal is to make this system compatible with the Linux ABI, so that musl libc and busybox can be easily ported, thereby introducing the ability to depend on more Linux software. Although this goal is very distant, I still decided to try. I have chosen to use C++ as the development language, even though many people think C++ is not a language for developing kernels, I believe that the object-oriented features of C++ can make system code easier to read and understand. Compared to reading various complex macros, reading some object-oriented code might be easier for people unfamiliar with the kernel. Therefore, I decided to sacrifice some performance along with extra handling for the C++ runtime in order to achieve this; after all, you have to give up something to gain something. -The source code of the new system is placed in the `na` (New Architecture) directory, welcome to read it. After learning about the development history of Windows NT, I realized the importance of documentation. The NT team spent a lot of time writing documentation before writing the first line of code, and by the time they wrote code, the system was basically finalized. As a student who is not particularly outstanding, I cannot complete the design of the system before starting to write code, but I can decide on its design before starting each part, and then adjust it according to reality. The documents are in `docs/specs/` directory. +The actively developed kernel now lives at the repository root. The previous implementation has been archived in `lume-legacy/` for reference. After learning about the development history of Windows NT, I realized the importance of documentation. The NT team spent a lot of time writing documentation before writing the first line of code, and by the time they wrote code, the system was basically finalized. As a student who is not particularly outstanding, I cannot complete the design of the system before starting to write code, but I can decide on its design before starting each part, and then adjust it according to reality. The documents are in `docs/specs/` directory. It can basically be concluded that writing an operating system in this era is a thankless task. A personally implemented operating system may never run on machines beyond my own tests, so what is the point of doing this? Perhaps it is just to add color to a monotonous life. However, if you really have ideas, you are welcome to contact me. @@ -102,4 +102,4 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. -See the [LICENSE](LICENSE) file for details.
\ No newline at end of file +See the [LICENSE](LICENSE) file for details. diff --git a/na/arch/riscv/config.cc b/arch/riscv/config.cc index a18a825..a18a825 100644 --- a/na/arch/riscv/config.cc +++ b/arch/riscv/config.cc diff --git a/na/arch/riscv/defconfig b/arch/riscv/defconfig index 87d3ffd..87d3ffd 100644 --- a/na/arch/riscv/defconfig +++ b/arch/riscv/defconfig diff --git a/na/arch/riscv/include/arch/config.h b/arch/riscv/include/arch/config.h index 8ae0502..8ae0502 100644 --- a/na/arch/riscv/include/arch/config.h +++ b/arch/riscv/include/arch/config.h diff --git a/na/arch/riscv/include/arch/context.h b/arch/riscv/include/arch/context.h index 3d935fa..3d935fa 100644 --- a/na/arch/riscv/include/arch/context.h +++ b/arch/riscv/include/arch/context.h diff --git a/na/arch/riscv/include/arch/cpu.h b/arch/riscv/include/arch/cpu.h index 8c573ec..8c573ec 100644 --- a/na/arch/riscv/include/arch/cpu.h +++ b/arch/riscv/include/arch/cpu.h diff --git a/na/arch/riscv/include/arch/extable.h b/arch/riscv/include/arch/extable.h index eb2daac..eb2daac 100644 --- a/na/arch/riscv/include/arch/extable.h +++ b/arch/riscv/include/arch/extable.h diff --git a/na/arch/riscv/include/arch/fpstate.h b/arch/riscv/include/arch/fpstate.h index 4b42a22..4b42a22 100644 --- a/na/arch/riscv/include/arch/fpstate.h +++ b/arch/riscv/include/arch/fpstate.h diff --git a/na/arch/riscv/include/arch/mmu.h b/arch/riscv/include/arch/mmu.h index f4c9b26..f4c9b26 100644 --- a/na/arch/riscv/include/arch/mmu.h +++ b/arch/riscv/include/arch/mmu.h diff --git a/na/arch/riscv/include/arch/pmap.h b/arch/riscv/include/arch/pmap.h index 0b43b9e..0b43b9e 100644 --- a/na/arch/riscv/include/arch/pmap.h +++ b/arch/riscv/include/arch/pmap.h diff --git a/na/arch/riscv/include/arch/random.h b/arch/riscv/include/arch/random.h index 8c8c051..8c8c051 100644 --- a/na/arch/riscv/include/arch/random.h +++ b/arch/riscv/include/arch/random.h diff --git a/na/arch/riscv/include/arch/sbi.h b/arch/riscv/include/arch/sbi.h index 80a6d7c..80a6d7c 100644 --- a/na/arch/riscv/include/arch/sbi.h +++ b/arch/riscv/include/arch/sbi.h diff --git a/na/arch/riscv/include/arch/tlb.h b/arch/riscv/include/arch/tlb.h index 46c6b97..46c6b97 100644 --- a/na/arch/riscv/include/arch/tlb.h +++ b/arch/riscv/include/arch/tlb.h diff --git a/na/arch/riscv/include/arch/trap.h b/arch/riscv/include/arch/trap.h index 8e55250..8e55250 100644 --- a/na/arch/riscv/include/arch/trap.h +++ b/arch/riscv/include/arch/trap.h diff --git a/na/arch/riscv/include/arch/trapframe.h b/arch/riscv/include/arch/trapframe.h index b198646..b198646 100644 --- a/na/arch/riscv/include/arch/trapframe.h +++ b/arch/riscv/include/arch/trapframe.h diff --git a/na/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index 42f1eb4..42f1eb4 100644 --- a/na/arch/riscv/include/asm/csr.h +++ b/arch/riscv/include/asm/csr.h diff --git a/na/arch/riscv/include/asm/page.h b/arch/riscv/include/asm/page.h index 7b9f155..7b9f155 100644 --- a/na/arch/riscv/include/asm/page.h +++ b/arch/riscv/include/asm/page.h diff --git a/na/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 28fc4c5..28fc4c5 100644 --- a/na/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h diff --git a/na/arch/riscv/include/asm/sections.h b/arch/riscv/include/asm/sections.h index 454d9de..454d9de 100644 --- a/na/arch/riscv/include/asm/sections.h +++ b/arch/riscv/include/asm/sections.h diff --git a/na/arch/riscv/kernel/asm-offsets.c b/arch/riscv/kernel/asm-offsets.c index edecab7..edecab7 100644 --- a/na/arch/riscv/kernel/asm-offsets.c +++ b/arch/riscv/kernel/asm-offsets.c diff --git a/na/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S index e04c44c..e04c44c 100644 --- a/na/arch/riscv/kernel/head.S +++ b/arch/riscv/kernel/head.S diff --git a/na/arch/riscv/kernel/lumeos.lds.S b/arch/riscv/kernel/lumeos.lds.S index 9bd083b..9bd083b 100644 --- a/na/arch/riscv/kernel/lumeos.lds.S +++ b/arch/riscv/kernel/lumeos.lds.S diff --git a/na/arch/riscv/kernel/signal.cc b/arch/riscv/kernel/signal.cc index 39fe34e..39fe34e 100644 --- a/na/arch/riscv/kernel/signal.cc +++ b/arch/riscv/kernel/signal.cc diff --git a/na/arch/riscv/lib/random.cc b/arch/riscv/lib/random.cc index afc0078..afc0078 100644 --- a/na/arch/riscv/lib/random.cc +++ b/arch/riscv/lib/random.cc diff --git a/na/arch/riscv/mm/init.cc b/arch/riscv/mm/init.cc index 3cebcd9..3cebcd9 100644 --- a/na/arch/riscv/mm/init.cc +++ b/arch/riscv/mm/init.cc diff --git a/na/arch/riscv/mm/pmap.cc b/arch/riscv/mm/pmap.cc index f0a6848..f0a6848 100644 --- a/na/arch/riscv/mm/pmap.cc +++ b/arch/riscv/mm/pmap.cc diff --git a/na/arch/riscv/mm/tlb_md.cc b/arch/riscv/mm/tlb_md.cc index ed9aa29..ed9aa29 100644 --- a/na/arch/riscv/mm/tlb_md.cc +++ b/arch/riscv/mm/tlb_md.cc diff --git a/na/arch/riscv/module.mk b/arch/riscv/module.mk index 97d22de..97d22de 100644 --- a/na/arch/riscv/module.mk +++ b/arch/riscv/module.mk diff --git a/na/arch/riscv/syscall/syscall_md.cc b/arch/riscv/syscall/syscall_md.cc index 26320c8..26320c8 100644 --- a/na/arch/riscv/syscall/syscall_md.cc +++ b/arch/riscv/syscall/syscall_md.cc diff --git a/na/arch/riscv/trap/extable.cc b/arch/riscv/trap/extable.cc index 57a3dc1..57a3dc1 100644 --- a/na/arch/riscv/trap/extable.cc +++ b/arch/riscv/trap/extable.cc diff --git a/na/arch/riscv/trap/fpu.S b/arch/riscv/trap/fpu.S index 90d96d9..90d96d9 100644 --- a/na/arch/riscv/trap/fpu.S +++ b/arch/riscv/trap/fpu.S diff --git a/na/arch/riscv/trap/swtch.S b/arch/riscv/trap/swtch.S index dbae43d..dbae43d 100644 --- a/na/arch/riscv/trap/swtch.S +++ b/arch/riscv/trap/swtch.S diff --git a/na/arch/riscv/trap/trap_md.cc b/arch/riscv/trap/trap_md.cc index e30aea6..e30aea6 100644 --- a/na/arch/riscv/trap/trap_md.cc +++ b/arch/riscv/trap/trap_md.cc diff --git a/na/arch/riscv/trap/trap_vector.S b/arch/riscv/trap/trap_vector.S index 8e45cae..8e45cae 100644 --- a/na/arch/riscv/trap/trap_vector.S +++ b/arch/riscv/trap/trap_vector.S diff --git a/na/arch/riscv/uaccess/uaccess_memcpy.S b/arch/riscv/uaccess/uaccess_memcpy.S index 615680d..615680d 100644 --- a/na/arch/riscv/uaccess/uaccess_memcpy.S +++ b/arch/riscv/uaccess/uaccess_memcpy.S diff --git a/na/drivers/base/bus.cc b/drivers/base/bus.cc index 975f676..975f676 100644 --- a/na/drivers/base/bus.cc +++ b/drivers/base/bus.cc diff --git a/na/drivers/base/core.cc b/drivers/base/core.cc index f92b2a4..f92b2a4 100644 --- a/na/drivers/base/core.cc +++ b/drivers/base/core.cc diff --git a/na/drivers/base/driver.cc b/drivers/base/driver.cc index ce15b6d..ce15b6d 100644 --- a/na/drivers/base/driver.cc +++ b/drivers/base/driver.cc diff --git a/na/drivers/base/module.mk b/drivers/base/module.mk index 1d8fb05..1d8fb05 100644 --- a/na/drivers/base/module.mk +++ b/drivers/base/module.mk diff --git a/na/drivers/base/platform.cc b/drivers/base/platform.cc index 65ec21e..65ec21e 100644 --- a/na/drivers/base/platform.cc +++ b/drivers/base/platform.cc diff --git a/na/drivers/console.cc b/drivers/console.cc index f741dd2..f741dd2 100644 --- a/na/drivers/console.cc +++ b/drivers/console.cc diff --git a/na/drivers/module.mk b/drivers/module.mk index 9326f30..9326f30 100644 --- a/na/drivers/module.mk +++ b/drivers/module.mk diff --git a/na/drivers/plic.cc b/drivers/plic.cc index 2818700..2818700 100644 --- a/na/drivers/plic.cc +++ b/drivers/plic.cc diff --git a/na/drivers/tty/module.mk b/drivers/tty/module.mk index 49190d4..49190d4 100644 --- a/na/drivers/tty/module.mk +++ b/drivers/tty/module.mk diff --git a/na/drivers/tty/n_tty.cc b/drivers/tty/n_tty.cc index 0e312b0..0e312b0 100644 --- a/na/drivers/tty/n_tty.cc +++ b/drivers/tty/n_tty.cc diff --git a/na/drivers/tty/tty_core.cc b/drivers/tty/tty_core.cc index 5985bd9..5985bd9 100644 --- a/na/drivers/tty/tty_core.cc +++ b/drivers/tty/tty_core.cc diff --git a/na/drivers/tty/tty_uart.cc b/drivers/tty/tty_uart.cc index 973a6e9..973a6e9 100644 --- a/na/drivers/tty/tty_uart.cc +++ b/drivers/tty/tty_uart.cc diff --git a/na/drivers/uart.cc b/drivers/uart.cc index 467b496..467b496 100644 --- a/na/drivers/uart.cc +++ b/drivers/uart.cc diff --git a/na/fdt/device_node.cc b/fdt/device_node.cc index 0c8ad46..0c8ad46 100644 --- a/na/fdt/device_node.cc +++ b/fdt/device_node.cc diff --git a/na/fdt/fdt.cc b/fdt/fdt.cc index d44ebda..d44ebda 100644 --- a/na/fdt/fdt.cc +++ b/fdt/fdt.cc diff --git a/na/fdt/module.mk b/fdt/module.mk index 3e490ca..3e490ca 100644 --- a/na/fdt/module.mk +++ b/fdt/module.mk diff --git a/na/fs/chardev.cc b/fs/chardev.cc index fa96276..fa96276 100644 --- a/na/fs/chardev.cc +++ b/fs/chardev.cc diff --git a/na/fs/dcache.cc b/fs/dcache.cc index 94ab287..94ab287 100644 --- a/na/fs/dcache.cc +++ b/fs/dcache.cc diff --git a/na/fs/devfs.cc b/fs/devfs.cc index b4b2cf3..b4b2cf3 100644 --- a/na/fs/devfs.cc +++ b/fs/devfs.cc diff --git a/na/fs/file_table.cc b/fs/file_table.cc index 06095c1..06095c1 100644 --- a/na/fs/file_table.cc +++ b/fs/file_table.cc diff --git a/na/fs/fs_struct.cc b/fs/fs_struct.cc index 090819f..090819f 100644 --- a/na/fs/fs_struct.cc +++ b/fs/fs_struct.cc diff --git a/na/fs/initramfs.cc b/fs/initramfs.cc index ba10a3e..ba10a3e 100644 --- a/na/fs/initramfs.cc +++ b/fs/initramfs.cc diff --git a/na/fs/inode.cc b/fs/inode.cc index 1d3d006..1d3d006 100644 --- a/na/fs/inode.cc +++ b/fs/inode.cc diff --git a/na/fs/module.mk b/fs/module.mk index f1be157..f1be157 100644 --- a/na/fs/module.mk +++ b/fs/module.mk diff --git a/na/fs/namei.cc b/fs/namei.cc index 9124ea9..9124ea9 100644 --- a/na/fs/namei.cc +++ b/fs/namei.cc diff --git a/na/fs/pipe.cc b/fs/pipe.cc index f7708f5..f7708f5 100644 --- a/na/fs/pipe.cc +++ b/fs/pipe.cc diff --git a/na/fs/ramfs/file.cc b/fs/ramfs/file.cc index 6d9a070..6d9a070 100644 --- a/na/fs/ramfs/file.cc +++ b/fs/ramfs/file.cc diff --git a/na/fs/ramfs/inode.cc b/fs/ramfs/inode.cc index c5e49bf..c5e49bf 100644 --- a/na/fs/ramfs/inode.cc +++ b/fs/ramfs/inode.cc diff --git a/na/fs/ramfs/super.cc b/fs/ramfs/super.cc index 6f929f2..6f929f2 100644 --- a/na/fs/ramfs/super.cc +++ b/fs/ramfs/super.cc diff --git a/na/fs/super.cc b/fs/super.cc index 231b57c..231b57c 100644 --- a/na/fs/super.cc +++ b/fs/super.cc diff --git a/na/fs/vfs_init.cc b/fs/vfs_init.cc index ec56e88..ec56e88 100644 --- a/na/fs/vfs_init.cc +++ b/fs/vfs_init.cc diff --git a/na/include/libc-shim/bits/alltypes.h b/include/libc-shim/bits/alltypes.h index cf21a5e..cf21a5e 100644 --- a/na/include/libc-shim/bits/alltypes.h +++ b/include/libc-shim/bits/alltypes.h diff --git a/na/include/libc-shim/endian.h b/include/libc-shim/endian.h index 8346386..8346386 100644 --- a/na/include/libc-shim/endian.h +++ b/include/libc-shim/endian.h diff --git a/na/include/libc-shim/features.h b/include/libc-shim/features.h index a3466c8..a3466c8 100644 --- a/na/include/libc-shim/features.h +++ b/include/libc-shim/features.h diff --git a/na/include/libc-shim/limits.h b/include/libc-shim/limits.h index a1d546e..a1d546e 100644 --- a/na/include/libc-shim/limits.h +++ b/include/libc-shim/limits.h diff --git a/na/include/libc-shim/stdint.h b/include/libc-shim/stdint.h index 650bdcf..650bdcf 100644 --- a/na/include/libc-shim/stdint.h +++ b/include/libc-shim/stdint.h diff --git a/na/include/libc-shim/string.h b/include/libc-shim/string.h index 8a86304..8a86304 100644 --- a/na/include/libc-shim/string.h +++ b/include/libc-shim/string.h diff --git a/na/include/libc-shim/strings.h b/include/libc-shim/strings.h index b7a5ea0..b7a5ea0 100644 --- a/na/include/libc-shim/strings.h +++ b/include/libc-shim/strings.h diff --git a/na/include/lume/addr.h b/include/lume/addr.h index 572b6fe..572b6fe 100644 --- a/na/include/lume/addr.h +++ b/include/lume/addr.h diff --git a/na/include/lume/addr_types.h b/include/lume/addr_types.h index 91a0779..91a0779 100644 --- a/na/include/lume/addr_types.h +++ b/include/lume/addr_types.h diff --git a/na/include/lume/args.h b/include/lume/args.h index 0562dc5..0562dc5 100644 --- a/na/include/lume/args.h +++ b/include/lume/args.h diff --git a/na/include/lume/atomic.h b/include/lume/atomic.h index 6e31129..6e31129 100644 --- a/na/include/lume/atomic.h +++ b/include/lume/atomic.h diff --git a/na/include/lume/bitops.h b/include/lume/bitops.h index 4227ca3..4227ca3 100644 --- a/na/include/lume/bitops.h +++ b/include/lume/bitops.h diff --git a/na/include/lume/chardev.h b/include/lume/chardev.h index be81ab9..be81ab9 100644 --- a/na/include/lume/chardev.h +++ b/include/lume/chardev.h diff --git a/na/include/lume/clone.h b/include/lume/clone.h index 156bae4..156bae4 100644 --- a/na/include/lume/clone.h +++ b/include/lume/clone.h diff --git a/na/include/lume/compiler.h b/include/lume/compiler.h index 243f0de..243f0de 100644 --- a/na/include/lume/compiler.h +++ b/include/lume/compiler.h diff --git a/na/include/lume/config.h b/include/lume/config.h index bde717a..bde717a 100644 --- a/na/include/lume/config.h +++ b/include/lume/config.h diff --git a/na/include/lume/console.h b/include/lume/console.h index af187a6..af187a6 100644 --- a/na/include/lume/console.h +++ b/include/lume/console.h diff --git a/na/include/lume/container_of.h b/include/lume/container_of.h index a6889eb..a6889eb 100644 --- a/na/include/lume/container_of.h +++ b/include/lume/container_of.h diff --git a/na/include/lume/dcache.h b/include/lume/dcache.h index a31402e..a31402e 100644 --- a/na/include/lume/dcache.h +++ b/include/lume/dcache.h diff --git a/na/include/lume/device.h b/include/lume/device.h index 46e22e4..46e22e4 100644 --- a/na/include/lume/device.h +++ b/include/lume/device.h diff --git a/na/include/lume/device_node.h b/include/lume/device_node.h index e35f22d..e35f22d 100644 --- a/na/include/lume/device_node.h +++ b/include/lume/device_node.h diff --git a/na/include/lume/driver.h b/include/lume/driver.h index a8bd787..a8bd787 100644 --- a/na/include/lume/driver.h +++ b/include/lume/driver.h diff --git a/na/include/lume/elf.h b/include/lume/elf.h index 772ad97..772ad97 100644 --- a/na/include/lume/elf.h +++ b/include/lume/elf.h diff --git a/na/include/lume/errno.h b/include/lume/errno.h index f3bf09f..f3bf09f 100644 --- a/na/include/lume/errno.h +++ b/include/lume/errno.h diff --git a/na/include/lume/fdt.h b/include/lume/fdt.h index 626cc48..626cc48 100644 --- a/na/include/lume/fdt.h +++ b/include/lume/fdt.h diff --git a/na/include/lume/fdt_prop.h b/include/lume/fdt_prop.h index f8a263c..f8a263c 100644 --- a/na/include/lume/fdt_prop.h +++ b/include/lume/fdt_prop.h diff --git a/na/include/lume/fdtable.h b/include/lume/fdtable.h index 6159519..6159519 100644 --- a/na/include/lume/fdtable.h +++ b/include/lume/fdtable.h diff --git a/na/include/lume/features.h b/include/lume/features.h index 85cfb72..85cfb72 100644 --- a/na/include/lume/features.h +++ b/include/lume/features.h diff --git a/na/include/lume/file.h b/include/lume/file.h index 349059b..349059b 100644 --- a/na/include/lume/file.h +++ b/include/lume/file.h diff --git a/na/include/lume/fs.h b/include/lume/fs.h index 8dac552..8dac552 100644 --- a/na/include/lume/fs.h +++ b/include/lume/fs.h diff --git a/na/include/lume/fs_struct.h b/include/lume/fs_struct.h index ba643b5..ba643b5 100644 --- a/na/include/lume/fs_struct.h +++ b/include/lume/fs_struct.h diff --git a/na/include/lume/fs_types.h b/include/lume/fs_types.h index 767f37c..767f37c 100644 --- a/na/include/lume/fs_types.h +++ b/include/lume/fs_types.h diff --git a/na/include/lume/init.h b/include/lume/init.h index 541ab96..541ab96 100644 --- a/na/include/lume/init.h +++ b/include/lume/init.h diff --git a/na/include/lume/irq.h b/include/lume/irq.h index f5f34e4..f5f34e4 100644 --- a/na/include/lume/irq.h +++ b/include/lume/irq.h diff --git a/na/include/lume/kbuild.h b/include/lume/kbuild.h index 4c3e12a..4c3e12a 100644 --- a/na/include/lume/kbuild.h +++ b/include/lume/kbuild.h diff --git a/na/include/lume/kernel_map.h b/include/lume/kernel_map.h index 7eafe88..7eafe88 100644 --- a/na/include/lume/kernel_map.h +++ b/include/lume/kernel_map.h diff --git a/na/include/lume/klog.h b/include/lume/klog.h index 69ab269..69ab269 100644 --- a/na/include/lume/klog.h +++ b/include/lume/klog.h diff --git a/na/include/lume/kobject.h b/include/lume/kobject.h index 8581d6e..8581d6e 100644 --- a/na/include/lume/kobject.h +++ b/include/lume/kobject.h diff --git a/na/include/lume/kprintf.h b/include/lume/kprintf.h index b158602..b158602 100644 --- a/na/include/lume/kprintf.h +++ b/include/lume/kprintf.h diff --git a/na/include/lume/kref.h b/include/lume/kref.h index 13d53f3..13d53f3 100644 --- a/na/include/lume/kref.h +++ b/include/lume/kref.h diff --git a/na/include/lume/libfdt.h b/include/lume/libfdt.h index e3496e9..e3496e9 100644 --- a/na/include/lume/libfdt.h +++ b/include/lume/libfdt.h diff --git a/na/include/lume/libfdt_env.h b/include/lume/libfdt_env.h index a95fb1d..a95fb1d 100644 --- a/na/include/lume/libfdt_env.h +++ b/include/lume/libfdt_env.h diff --git a/na/include/lume/limits.h b/include/lume/limits.h index a275a71..a275a71 100644 --- a/na/include/lume/limits.h +++ b/include/lume/limits.h diff --git a/na/include/lume/list.h b/include/lume/list.h index ed1202a..ed1202a 100644 --- a/na/include/lume/list.h +++ b/include/lume/list.h diff --git a/na/include/lume/lumeos.lds.h b/include/lume/lumeos.lds.h index 58d2f72..58d2f72 100644 --- a/na/include/lume/lumeos.lds.h +++ b/include/lume/lumeos.lds.h diff --git a/na/include/lume/memblock.h b/include/lume/memblock.h index cb9a76b..cb9a76b 100644 --- a/na/include/lume/memblock.h +++ b/include/lume/memblock.h diff --git a/na/include/lume/mm_layout.h b/include/lume/mm_layout.h index 7744de0..7744de0 100644 --- a/na/include/lume/mm_layout.h +++ b/include/lume/mm_layout.h diff --git a/na/include/lume/mman.h b/include/lume/mman.h index d952419..d952419 100644 --- a/na/include/lume/mman.h +++ b/include/lume/mman.h diff --git a/na/include/lume/mount.h b/include/lume/mount.h index 13f8e62..13f8e62 100644 --- a/na/include/lume/mount.h +++ b/include/lume/mount.h diff --git a/na/include/lume/mutex.h b/include/lume/mutex.h index 9719aa6..9719aa6 100644 --- a/na/include/lume/mutex.h +++ b/include/lume/mutex.h diff --git a/na/include/lume/namei.h b/include/lume/namei.h index 1764693..1764693 100644 --- a/na/include/lume/namei.h +++ b/include/lume/namei.h diff --git a/na/include/lume/new.h b/include/lume/new.h index cdcacb8..cdcacb8 100644 --- a/na/include/lume/new.h +++ b/include/lume/new.h diff --git a/na/include/lume/page.h b/include/lume/page.h index 61bff95..61bff95 100644 --- a/na/include/lume/page.h +++ b/include/lume/page.h diff --git a/na/include/lume/page_cache.h b/include/lume/page_cache.h index abdc535..abdc535 100644 --- a/na/include/lume/page_cache.h +++ b/include/lume/page_cache.h diff --git a/na/include/lume/pgrp.h b/include/lume/pgrp.h index 127f3f8..127f3f8 100644 --- a/na/include/lume/pgrp.h +++ b/include/lume/pgrp.h diff --git a/na/include/lume/pgtable_types.h b/include/lume/pgtable_types.h index e309a82..e309a82 100644 --- a/na/include/lume/pgtable_types.h +++ b/include/lume/pgtable_types.h diff --git a/na/include/lume/pid.h b/include/lume/pid.h index 8503750..8503750 100644 --- a/na/include/lume/pid.h +++ b/include/lume/pid.h diff --git a/na/include/lume/pipe.h b/include/lume/pipe.h index c905c9a..c905c9a 100644 --- a/na/include/lume/pipe.h +++ b/include/lume/pipe.h diff --git a/na/include/lume/platform_device.h b/include/lume/platform_device.h index ac3e527..ac3e527 100644 --- a/na/include/lume/platform_device.h +++ b/include/lume/platform_device.h diff --git a/na/include/lume/pmm.h b/include/lume/pmm.h index 3e4b819..3e4b819 100644 --- a/na/include/lume/pmm.h +++ b/include/lume/pmm.h diff --git a/na/include/lume/poll.h b/include/lume/poll.h index 7d5bca2..7d5bca2 100644 --- a/na/include/lume/poll.h +++ b/include/lume/poll.h diff --git a/na/include/lume/ptrace.h b/include/lume/ptrace.h index 687d103..687d103 100644 --- a/na/include/lume/ptrace.h +++ b/include/lume/ptrace.h diff --git a/na/include/lume/random.h b/include/lume/random.h index 740b060..740b060 100644 --- a/na/include/lume/random.h +++ b/include/lume/random.h diff --git a/na/include/lume/rbtree.h b/include/lume/rbtree.h index 80b0c6c..80b0c6c 100644 --- a/na/include/lume/rbtree.h +++ b/include/lume/rbtree.h diff --git a/na/include/lume/rbtree_augmented.h b/include/lume/rbtree_augmented.h index d4559c4..d4559c4 100644 --- a/na/include/lume/rbtree_augmented.h +++ b/include/lume/rbtree_augmented.h diff --git a/na/include/lume/rbtree_types.h b/include/lume/rbtree_types.h index 688ade4..688ade4 100644 --- a/na/include/lume/rbtree_types.h +++ b/include/lume/rbtree_types.h diff --git a/na/include/lume/sched.h b/include/lume/sched.h index ab26bac..ab26bac 100644 --- a/na/include/lume/sched.h +++ b/include/lume/sched.h diff --git a/na/include/lume/sched_class.h b/include/lume/sched_class.h index 08686c1..08686c1 100644 --- a/na/include/lume/sched_class.h +++ b/include/lume/sched_class.h diff --git a/na/include/lume/selftest.h b/include/lume/selftest.h index 7040986..7040986 100644 --- a/na/include/lume/selftest.h +++ b/include/lume/selftest.h diff --git a/na/include/lume/setup.h b/include/lume/setup.h index f8e6cb6..f8e6cb6 100644 --- a/na/include/lume/setup.h +++ b/include/lume/setup.h diff --git a/na/include/lume/signal.h b/include/lume/signal.h index 05b7542..05b7542 100644 --- a/na/include/lume/signal.h +++ b/include/lume/signal.h diff --git a/na/include/lume/signal_nr.h b/include/lume/signal_nr.h index 8e595d7..8e595d7 100644 --- a/na/include/lume/signal_nr.h +++ b/include/lume/signal_nr.h diff --git a/na/include/lume/signal_types.h b/include/lume/signal_types.h index f66231b..f66231b 100644 --- a/na/include/lume/signal_types.h +++ b/include/lume/signal_types.h diff --git a/na/include/lume/slab.h b/include/lume/slab.h index 4ebade1..4ebade1 100644 --- a/na/include/lume/slab.h +++ b/include/lume/slab.h diff --git a/na/include/lume/smp.h b/include/lume/smp.h index a5292b6..a5292b6 100644 --- a/na/include/lume/smp.h +++ b/include/lume/smp.h diff --git a/na/include/lume/stdarg.h b/include/lume/stdarg.h index c8dc7f4..c8dc7f4 100644 --- a/na/include/lume/stdarg.h +++ b/include/lume/stdarg.h diff --git a/na/include/lume/stringify.h b/include/lume/stringify.h index 0e84cbe..0e84cbe 100644 --- a/na/include/lume/stringify.h +++ b/include/lume/stringify.h diff --git a/na/include/lume/syscall.h b/include/lume/syscall.h index 8185096..8185096 100644 --- a/na/include/lume/syscall.h +++ b/include/lume/syscall.h diff --git a/na/include/lume/syscall_nr.h b/include/lume/syscall_nr.h index 29e3904..29e3904 100644 --- a/na/include/lume/syscall_nr.h +++ b/include/lume/syscall_nr.h diff --git a/na/include/lume/task.h b/include/lume/task.h index e959147..e959147 100644 --- a/na/include/lume/task.h +++ b/include/lume/task.h diff --git a/na/include/lume/timer.h b/include/lume/timer.h index 9bdddd5..9bdddd5 100644 --- a/na/include/lume/timer.h +++ b/include/lume/timer.h diff --git a/na/include/lume/tlb.h b/include/lume/tlb.h index b4d51ea..b4d51ea 100644 --- a/na/include/lume/tlb.h +++ b/include/lume/tlb.h diff --git a/na/include/lume/trap.h b/include/lume/trap.h index 61a5054..61a5054 100644 --- a/na/include/lume/trap.h +++ b/include/lume/trap.h diff --git a/na/include/lume/tty.h b/include/lume/tty.h index 34cf7bb..34cf7bb 100644 --- a/na/include/lume/tty.h +++ b/include/lume/tty.h diff --git a/na/include/lume/tty_ioctl.h b/include/lume/tty_ioctl.h index 87ba59b..87ba59b 100644 --- a/na/include/lume/tty_ioctl.h +++ b/include/lume/tty_ioctl.h diff --git a/na/include/lume/types.h b/include/lume/types.h index 2342359..2342359 100644 --- a/na/include/lume/types.h +++ b/include/lume/types.h diff --git a/na/include/lume/uaccess.h b/include/lume/uaccess.h index 5a9ed71..5a9ed71 100644 --- a/na/include/lume/uaccess.h +++ b/include/lume/uaccess.h diff --git a/na/include/lume/uuid.h b/include/lume/uuid.h index fcbd4a3..fcbd4a3 100644 --- a/na/include/lume/uuid.h +++ b/include/lume/uuid.h diff --git a/na/include/lume/vmm.h b/include/lume/vmm.h index 9cbebf1..9cbebf1 100644 --- a/na/include/lume/vmm.h +++ b/include/lume/vmm.h diff --git a/na/include/lume/wait.h b/include/lume/wait.h index 865c1f2..865c1f2 100644 --- a/na/include/lume/wait.h +++ b/include/lume/wait.h diff --git a/na/include/lume/waitqueue.h b/include/lume/waitqueue.h index 3720cb7..3720cb7 100644 --- a/na/include/lume/waitqueue.h +++ b/include/lume/waitqueue.h diff --git a/na/kernel/exec.cc b/kernel/exec.cc index 616c0da..616c0da 100644 --- a/na/kernel/exec.cc +++ b/kernel/exec.cc diff --git a/na/kernel/irq.cc b/kernel/irq.cc index 4de468a..4de468a 100644 --- a/na/kernel/irq.cc +++ b/kernel/irq.cc diff --git a/na/kernel/main.cc b/kernel/main.cc index db5843c..db5843c 100644 --- a/na/kernel/main.cc +++ b/kernel/main.cc diff --git a/na/kernel/module.mk b/kernel/module.mk index 754a14c..754a14c 100644 --- a/na/kernel/module.mk +++ b/kernel/module.mk diff --git a/na/kernel/pgrp.cc b/kernel/pgrp.cc index e5b382c..e5b382c 100644 --- a/na/kernel/pgrp.cc +++ b/kernel/pgrp.cc diff --git a/na/kernel/pid.cc b/kernel/pid.cc index 04b846b..04b846b 100644 --- a/na/kernel/pid.cc +++ b/kernel/pid.cc diff --git a/na/kernel/poll.cc b/kernel/poll.cc index 3674491..3674491 100644 --- a/na/kernel/poll.cc +++ b/kernel/poll.cc diff --git a/na/kernel/ptrace.cc b/kernel/ptrace.cc index 3280c07..3280c07 100644 --- a/na/kernel/ptrace.cc +++ b/kernel/ptrace.cc diff --git a/na/kernel/sched_class_o1.cc b/kernel/sched_class_o1.cc index 28c693c..28c693c 100644 --- a/na/kernel/sched_class_o1.cc +++ b/kernel/sched_class_o1.cc diff --git a/na/kernel/sched_core.cc b/kernel/sched_core.cc index c0e068e..c0e068e 100644 --- a/na/kernel/sched_core.cc +++ b/kernel/sched_core.cc diff --git a/na/kernel/sched_internal.h b/kernel/sched_internal.h index 514b613..514b613 100644 --- a/na/kernel/sched_internal.h +++ b/kernel/sched_internal.h diff --git a/na/kernel/signal.cc b/kernel/signal.cc index 53d26da..53d26da 100644 --- a/na/kernel/signal.cc +++ b/kernel/signal.cc diff --git a/na/kernel/smp.cc b/kernel/smp.cc index 1a79ac3..1a79ac3 100644 --- a/na/kernel/smp.cc +++ b/kernel/smp.cc diff --git a/na/kernel/sync/cpu_state.h b/kernel/sync/cpu_state.h index 1f7dde0..1f7dde0 100644 --- a/na/kernel/sync/cpu_state.h +++ b/kernel/sync/cpu_state.h diff --git a/na/kernel/sync/mutex.cc b/kernel/sync/mutex.cc index c4d3e9d..c4d3e9d 100644 --- a/na/kernel/sync/mutex.cc +++ b/kernel/sync/mutex.cc diff --git a/na/kernel/sync/spinlock.cc b/kernel/sync/spinlock.cc index f649fe7..f649fe7 100644 --- a/na/kernel/sync/spinlock.cc +++ b/kernel/sync/spinlock.cc diff --git a/na/kernel/sync/spinlock.h b/kernel/sync/spinlock.h index a1369d1..a1369d1 100644 --- a/na/kernel/sync/spinlock.h +++ b/kernel/sync/spinlock.h diff --git a/na/kernel/sys_fs.cc b/kernel/sys_fs.cc index 1d26fdd..1d26fdd 100644 --- a/na/kernel/sys_fs.cc +++ b/kernel/sys_fs.cc diff --git a/na/kernel/sys_info.cc b/kernel/sys_info.cc index 79baab0..79baab0 100644 --- a/na/kernel/sys_info.cc +++ b/kernel/sys_info.cc diff --git a/na/kernel/sys_misc.cc b/kernel/sys_misc.cc index 48eb47b..48eb47b 100644 --- a/na/kernel/sys_misc.cc +++ b/kernel/sys_misc.cc diff --git a/na/kernel/sys_mm.cc b/kernel/sys_mm.cc index bfa067c..bfa067c 100644 --- a/na/kernel/sys_mm.cc +++ b/kernel/sys_mm.cc diff --git a/na/kernel/sys_process.cc b/kernel/sys_process.cc index 438ad1b..438ad1b 100644 --- a/na/kernel/sys_process.cc +++ b/kernel/sys_process.cc diff --git a/na/kernel/sys_signal.cc b/kernel/sys_signal.cc index 8b459d5..8b459d5 100644 --- a/na/kernel/sys_signal.cc +++ b/kernel/sys_signal.cc diff --git a/na/kernel/syscall.cc b/kernel/syscall.cc index a5b80ec..a5b80ec 100644 --- a/na/kernel/syscall.cc +++ b/kernel/syscall.cc diff --git a/na/kernel/task.cc b/kernel/task.cc index 9f9b043..9f9b043 100644 --- a/na/kernel/task.cc +++ b/kernel/task.cc diff --git a/na/kernel/timer.cc b/kernel/timer.cc index 3cf03cf..3cf03cf 100644 --- a/na/kernel/timer.cc +++ b/kernel/timer.cc diff --git a/na/kernel/trap.cc b/kernel/trap.cc index 2116d91..2116d91 100644 --- a/na/kernel/trap.cc +++ b/kernel/trap.cc diff --git a/na/kernel/uaccess.cc b/kernel/uaccess.cc index 14c5fb7..14c5fb7 100644 --- a/na/kernel/uaccess.cc +++ b/kernel/uaccess.cc diff --git a/na/kernel/waitqueue.cc b/kernel/waitqueue.cc index 9689417..9689417 100644 --- a/na/kernel/waitqueue.cc +++ b/kernel/waitqueue.cc diff --git a/na/lib/cxx_abi.cc b/lib/cxx_abi.cc index 872b4a2..872b4a2 100644 --- a/na/lib/cxx_abi.cc +++ b/lib/cxx_abi.cc diff --git a/na/lib/fdt_addresses.c b/lib/fdt_addresses.c index d58f896..d58f896 100644 --- a/na/lib/fdt_addresses.c +++ b/lib/fdt_addresses.c diff --git a/na/lib/fdt_empty_tree.c b/lib/fdt_empty_tree.c index 37f8ef8..37f8ef8 100644 --- a/na/lib/fdt_empty_tree.c +++ b/lib/fdt_empty_tree.c diff --git a/na/lib/fdt_ro.c b/lib/fdt_ro.c index 3599d49..3599d49 100644 --- a/na/lib/fdt_ro.c +++ b/lib/fdt_ro.c diff --git a/na/lib/fdt_rw.c b/lib/fdt_rw.c index 65d7a71..65d7a71 100644 --- a/na/lib/fdt_rw.c +++ b/lib/fdt_rw.c diff --git a/na/lib/fdt_strerror.c b/lib/fdt_strerror.c index dae35ea..dae35ea 100644 --- a/na/lib/fdt_strerror.c +++ b/lib/fdt_strerror.c diff --git a/na/lib/fdt_sw.c b/lib/fdt_sw.c index d04f220..d04f220 100644 --- a/na/lib/fdt_sw.c +++ b/lib/fdt_sw.c diff --git a/na/lib/fdt_wip.c b/lib/fdt_wip.c index ebfb3c1..ebfb3c1 100644 --- a/na/lib/fdt_wip.c +++ b/lib/fdt_wip.c diff --git a/na/lib/klog.cc b/lib/klog.cc index 86c67f8..86c67f8 100644 --- a/na/lib/klog.cc +++ b/lib/klog.cc diff --git a/na/lib/kobject.cc b/lib/kobject.cc index 8e8329e..8e8329e 100644 --- a/na/lib/kobject.cc +++ b/lib/kobject.cc diff --git a/na/lib/kprintf.cc b/lib/kprintf.cc index a98de71..a98de71 100644 --- a/na/lib/kprintf.cc +++ b/lib/kprintf.cc diff --git a/na/lib/module.mk b/lib/module.mk index 0b178f8..0b178f8 100644 --- a/na/lib/module.mk +++ b/lib/module.mk diff --git a/na/lib/printf.c b/lib/printf.c index 8a700ad..8a700ad 100644 --- a/na/lib/printf.c +++ b/lib/printf.c diff --git a/na/lib/printf.h b/lib/printf.h index 8aa23cf..8aa23cf 100644 --- a/na/lib/printf.h +++ b/lib/printf.h diff --git a/na/lib/random.cc b/lib/random.cc index 428c75c..428c75c 100644 --- a/na/lib/random.cc +++ b/lib/random.cc diff --git a/na/lib/rbtree.cc b/lib/rbtree.cc index 6718a1a..6718a1a 100644 --- a/na/lib/rbtree.cc +++ b/lib/rbtree.cc diff --git a/na/lib/string/COPYRIGHT b/lib/string/COPYRIGHT index 2f15edc..2f15edc 100644 --- a/na/lib/string/COPYRIGHT +++ b/lib/string/COPYRIGHT diff --git a/na/lib/string/aarch64/memcpy.S b/lib/string/aarch64/memcpy.S index 48bb8a8..48bb8a8 100644 --- a/na/lib/string/aarch64/memcpy.S +++ b/lib/string/aarch64/memcpy.S diff --git a/na/lib/string/aarch64/memset.S b/lib/string/aarch64/memset.S index f0d29b7..f0d29b7 100644 --- a/na/lib/string/aarch64/memset.S +++ b/lib/string/aarch64/memset.S diff --git a/na/lib/string/arm/__aeabi_memcpy.s b/lib/string/arm/__aeabi_memcpy.s index 3a527e4..3a527e4 100644 --- a/na/lib/string/arm/__aeabi_memcpy.s +++ b/lib/string/arm/__aeabi_memcpy.s diff --git a/na/lib/string/arm/__aeabi_memset.s b/lib/string/arm/__aeabi_memset.s index f9f6058..f9f6058 100644 --- a/na/lib/string/arm/__aeabi_memset.s +++ b/lib/string/arm/__aeabi_memset.s diff --git a/na/lib/string/arm/memcpy.S b/lib/string/arm/memcpy.S index 869e344..869e344 100644 --- a/na/lib/string/arm/memcpy.S +++ b/lib/string/arm/memcpy.S diff --git a/na/lib/string/bcmp.c b/lib/string/bcmp.c index d4c093f..d4c093f 100644 --- a/na/lib/string/bcmp.c +++ b/lib/string/bcmp.c diff --git a/na/lib/string/bcopy.c b/lib/string/bcopy.c index 25e98a2..25e98a2 100644 --- a/na/lib/string/bcopy.c +++ b/lib/string/bcopy.c diff --git a/na/lib/string/bzero.c b/lib/string/bzero.c index 08f1398..08f1398 100644 --- a/na/lib/string/bzero.c +++ b/lib/string/bzero.c diff --git a/na/lib/string/explicit_bzero.c b/lib/string/explicit_bzero.c index c94f25f..c94f25f 100644 --- a/na/lib/string/explicit_bzero.c +++ b/lib/string/explicit_bzero.c diff --git a/na/lib/string/i386/memcpy.s b/lib/string/i386/memcpy.s index 0608dd8..0608dd8 100644 --- a/na/lib/string/i386/memcpy.s +++ b/lib/string/i386/memcpy.s diff --git a/na/lib/string/i386/memmove.s b/lib/string/i386/memmove.s index 2a6a504..2a6a504 100644 --- a/na/lib/string/i386/memmove.s +++ b/lib/string/i386/memmove.s diff --git a/na/lib/string/i386/memset.s b/lib/string/i386/memset.s index d00422c..d00422c 100644 --- a/na/lib/string/i386/memset.s +++ b/lib/string/i386/memset.s diff --git a/na/lib/string/index.c b/lib/string/index.c index 8f6894c..8f6894c 100644 --- a/na/lib/string/index.c +++ b/lib/string/index.c diff --git a/na/lib/string/memccpy.c b/lib/string/memccpy.c index 99f146f..99f146f 100644 --- a/na/lib/string/memccpy.c +++ b/lib/string/memccpy.c diff --git a/na/lib/string/memchr.c b/lib/string/memchr.c index d0f670f..d0f670f 100644 --- a/na/lib/string/memchr.c +++ b/lib/string/memchr.c diff --git a/na/lib/string/memcmp.c b/lib/string/memcmp.c index 15606f4..15606f4 100644 --- a/na/lib/string/memcmp.c +++ b/lib/string/memcmp.c diff --git a/na/lib/string/memcpy.c b/lib/string/memcpy.c index de26a00..de26a00 100644 --- a/na/lib/string/memcpy.c +++ b/lib/string/memcpy.c diff --git a/na/lib/string/memmem.c b/lib/string/memmem.c index cfd23bb..cfd23bb 100644 --- a/na/lib/string/memmem.c +++ b/lib/string/memmem.c diff --git a/na/lib/string/memmove.c b/lib/string/memmove.c index 56e1a81..56e1a81 100644 --- a/na/lib/string/memmove.c +++ b/lib/string/memmove.c diff --git a/na/lib/string/mempcpy.c b/lib/string/mempcpy.c index 1f33e45..1f33e45 100644 --- a/na/lib/string/mempcpy.c +++ b/lib/string/mempcpy.c diff --git a/na/lib/string/memrchr.c b/lib/string/memrchr.c index 8d5c742..8d5c742 100644 --- a/na/lib/string/memrchr.c +++ b/lib/string/memrchr.c diff --git a/na/lib/string/memset.c b/lib/string/memset.c index e780c71..e780c71 100644 --- a/na/lib/string/memset.c +++ b/lib/string/memset.c diff --git a/na/lib/string/rindex.c b/lib/string/rindex.c index 897e19e..897e19e 100644 --- a/na/lib/string/rindex.c +++ b/lib/string/rindex.c diff --git a/na/lib/string/stpcpy.c b/lib/string/stpcpy.c index 0c1f1b4..0c1f1b4 100644 --- a/na/lib/string/stpcpy.c +++ b/lib/string/stpcpy.c diff --git a/na/lib/string/stpncpy.c b/lib/string/stpncpy.c index ca2ef78..ca2ef78 100644 --- a/na/lib/string/stpncpy.c +++ b/lib/string/stpncpy.c diff --git a/na/lib/string/strcat.c b/lib/string/strcat.c index 723c2ff..723c2ff 100644 --- a/na/lib/string/strcat.c +++ b/lib/string/strcat.c diff --git a/na/lib/string/strchr.c b/lib/string/strchr.c index ddeca01..ddeca01 100644 --- a/na/lib/string/strchr.c +++ b/lib/string/strchr.c diff --git a/na/lib/string/strchrnul.c b/lib/string/strchrnul.c index 6fc86d1..6fc86d1 100644 --- a/na/lib/string/strchrnul.c +++ b/lib/string/strchrnul.c diff --git a/na/lib/string/strcmp.c b/lib/string/strcmp.c index afcb1b7..afcb1b7 100644 --- a/na/lib/string/strcmp.c +++ b/lib/string/strcmp.c diff --git a/na/lib/string/strcpy.c b/lib/string/strcpy.c index a761577..a761577 100644 --- a/na/lib/string/strcpy.c +++ b/lib/string/strcpy.c diff --git a/na/lib/string/strcspn.c b/lib/string/strcspn.c index ba55fe6..ba55fe6 100644 --- a/na/lib/string/strcspn.c +++ b/lib/string/strcspn.c diff --git a/na/lib/string/strlcat.c b/lib/string/strlcat.c index a61821d..a61821d 100644 --- a/na/lib/string/strlcat.c +++ b/lib/string/strlcat.c diff --git a/na/lib/string/strlcpy.c b/lib/string/strlcpy.c index c2a5142..c2a5142 100644 --- a/na/lib/string/strlcpy.c +++ b/lib/string/strlcpy.c diff --git a/na/lib/string/strlen.c b/lib/string/strlen.c index 76e14f2..76e14f2 100644 --- a/na/lib/string/strlen.c +++ b/lib/string/strlen.c diff --git a/na/lib/string/strncat.c b/lib/string/strncat.c index a144e37..a144e37 100644 --- a/na/lib/string/strncat.c +++ b/lib/string/strncat.c diff --git a/na/lib/string/strncmp.c b/lib/string/strncmp.c index b98473b..b98473b 100644 --- a/na/lib/string/strncmp.c +++ b/lib/string/strncmp.c diff --git a/na/lib/string/strncpy.c b/lib/string/strncpy.c index a828465..a828465 100644 --- a/na/lib/string/strncpy.c +++ b/lib/string/strncpy.c diff --git a/na/lib/string/strnlen.c b/lib/string/strnlen.c index 8931c52..8931c52 100644 --- a/na/lib/string/strnlen.c +++ b/lib/string/strnlen.c diff --git a/na/lib/string/strpbrk.c b/lib/string/strpbrk.c index 82fbc92..82fbc92 100644 --- a/na/lib/string/strpbrk.c +++ b/lib/string/strpbrk.c diff --git a/na/lib/string/strrchr.c b/lib/string/strrchr.c index a45b459..a45b459 100644 --- a/na/lib/string/strrchr.c +++ b/lib/string/strrchr.c diff --git a/na/lib/string/strsep.c b/lib/string/strsep.c index 2d513f4..2d513f4 100644 --- a/na/lib/string/strsep.c +++ b/lib/string/strsep.c diff --git a/na/lib/string/strspn.c b/lib/string/strspn.c index f27710d..f27710d 100644 --- a/na/lib/string/strspn.c +++ b/lib/string/strspn.c diff --git a/na/lib/string/strstr.c b/lib/string/strstr.c index 07e2982..07e2982 100644 --- a/na/lib/string/strstr.c +++ b/lib/string/strstr.c diff --git a/na/lib/string/strtok.c b/lib/string/strtok.c index 86d9c97..86d9c97 100644 --- a/na/lib/string/strtok.c +++ b/lib/string/strtok.c diff --git a/na/lib/string/strtok_r.c b/lib/string/strtok_r.c index a702703..a702703 100644 --- a/na/lib/string/strtok_r.c +++ b/lib/string/strtok_r.c diff --git a/na/lib/string/x86_64/memcpy.s b/lib/string/x86_64/memcpy.s index 3d960ef..3d960ef 100644 --- a/na/lib/string/x86_64/memcpy.s +++ b/lib/string/x86_64/memcpy.s diff --git a/na/lib/string/x86_64/memmove.s b/lib/string/x86_64/memmove.s index 172c025..172c025 100644 --- a/na/lib/string/x86_64/memmove.s +++ b/lib/string/x86_64/memmove.s diff --git a/na/lib/string/x86_64/memset.s b/lib/string/x86_64/memset.s index 2d3f5e5..2d3f5e5 100644 --- a/na/lib/string/x86_64/memset.s +++ b/lib/string/x86_64/memset.s diff --git a/lume-legacy/Makefile b/lume-legacy/Makefile new file mode 100644 index 0000000..0722f8c --- /dev/null +++ b/lume-legacy/Makefile @@ -0,0 +1,141 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2026 Richard Qin + +# Try to find a suitable RISC-V toolchain prefix +ifndef TOOLCHAIN_PREFIX + TOOLCHAIN_PREFIX := $(shell \ + if command -v riscv64-linux-gnu-gcc >/dev/null 2>&1; then \ + echo riscv64-linux-gnu-; \ + elif command -v riscv64-unknown-gnu-gcc >/dev/null 2>&1; then \ + echo riscv64-unknown-gnu-; \ + elif command -v riscv64-unknown-linux-gnu-gcc >/dev/null 2>&1; then \ + echo riscv64-unknown-linux-gnu-; \ + elif command -v riscv64-unknown-elf-gcc >/dev/null 2>&1; then \ + echo riscv64-unknown-elf-; \ + else \ + echo riscv64-linux-gnu-; \ + fi) +endif + +CC := $(TOOLCHAIN_PREFIX)gcc +CXX := $(TOOLCHAIN_PREFIX)g++ +LD := $(TOOLCHAIN_PREFIX)ld +OBJCOPY := $(TOOLCHAIN_PREFIX)objcopy +OBJDUMP := $(TOOLCHAIN_PREFIX)objdump + +BUILD_DIR := build +SRC_DIR := src + +CFLAGS := -Wall -Wextra -O2 -g -ffreestanding -nostdlib -mcmodel=medany -Iinclude +CXXFLAGS := $(CFLAGS) -fno-exceptions -fno-rtti -fno-use-cxa-atexit +LINKER_SCRIPT := linker.ld + +USER_LD := $(SRC_DIR)/user/user.ld +ULIB_OBJS := $(BUILD_DIR)/user/entry.o \ + $(BUILD_DIR)/user/usys.o \ + $(BUILD_DIR)/ulib/stdio.o \ + $(BUILD_DIR)/ulib/stdlib.o \ + $(BUILD_DIR)/ulib/string.o \ + $(BUILD_DIR)/ulib/cxx.o \ + $(BUILD_DIR)/ulib/iostream.o \ + $(BUILD_DIR)/ulib/syscalls.o + +INITCODE_BIN := $(BUILD_DIR)/user/initcode + + +USER_SRCS := $(wildcard $(SRC_DIR)/user/*.cc) +UPROGS := $(patsubst $(SRC_DIR)/user/%.cc, $(BUILD_DIR)/user/%, $(USER_SRCS)) + +SRCS_S := $(shell find $(SRC_DIR) -name "*.S" -not -path "$(SRC_DIR)/user/*" -not -path "$(SRC_DIR)/ulib/*") +SRCS_CXX := $(shell find $(SRC_DIR) -name "*.cc" -not -path "$(SRC_DIR)/user/*" -not -path "$(SRC_DIR)/ulib/*") +OBJS := $(SRCS_S:%.S=$(BUILD_DIR)/%.o) $(SRCS_CXX:%.cc=$(BUILD_DIR)/%.o) + +TARGET := $(BUILD_DIR)/kernel.elf + +QEMUOPTS = -drive file=fs.img,if=none,format=raw,id=x0 +QEMUOPTS += -device virtio-blk-device,drive=x0 -global virtio-mmio.force-legacy=false + +.PHONY: all clean run debug + +all: $(TARGET) $(INITCODE_BIN) $(UPROGS) fs.img + + +$(BUILD_DIR)/ulib/%.o: $(SRC_DIR)/ulib/%.c + @mkdir -p $(dir $@) + @echo " ULIB_C $<" + @$(CC) $(CFLAGS) -c $< -o $@ + +$(BUILD_DIR)/ulib/%.o: $(SRC_DIR)/ulib/%.cc + @mkdir -p $(dir $@) + @echo " ULIB_CC $<" + @$(CXX) $(CXXFLAGS) -c $< -o $@ + +$(BUILD_DIR)/ulib/%.o: $(SRC_DIR)/ulib/%.cpp + @mkdir -p $(dir $@) + @echo " ULIB_CPP $<" + @$(CXX) $(CXXFLAGS) -c $< -o $@ + +$(BUILD_DIR)/user/%.o: $(SRC_DIR)/user/%.cc + @mkdir -p $(dir $@) + @echo " USER_CC $<" + @$(CXX) $(CXXFLAGS) -c $< -o $@ + +$(BUILD_DIR)/user/%.o: $(SRC_DIR)/user/%.S + @mkdir -p $(dir $@) + @echo " USER_AS $<" + @$(CC) $(CFLAGS) -c $< -o $@ + +$(INITCODE_BIN): $(BUILD_DIR)/user/init.o $(ULIB_OBJS) $(USER_LD) + @echo " U_LD $@" + @$(LD) -T $(USER_LD) -o $@.out $(BUILD_DIR)/user/init.o $(ULIB_OBJS) + @$(OBJCOPY) -S -O binary $@.out $@ + @$(OBJDUMP) -S $@.out > $@.asm + + +$(BUILD_DIR)/user/%: $(BUILD_DIR)/user/%.o $(ULIB_OBJS) $(USER_LD) + @echo " USER_LD $@" + @$(LD) -T $(USER_LD) -o $@ $< $(ULIB_OBJS) + @$(OBJDUMP) -S $@ > $@.asm + @$(OBJDUMP) -t $@ | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > $@.sym + + +$(TARGET): $(OBJS) $(LINKER_SCRIPT) + @echo " K_LD $@" + @$(LD) -T $(LINKER_SCRIPT) -o $@ $(OBJS) + @echo " K_ASM $@.asm" + @$(OBJDUMP) -S $@ > $@.asm + @$(OBJDUMP) -t $@ | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > $@.sym + +$(BUILD_DIR)/src/kernel/initcode.o: $(SRC_DIR)/kernel/initcode.S $(INITCODE_BIN) + @mkdir -p $(dir $@) + @echo " AS_INC $<" + @$(CC) $(CFLAGS) -c $< -o $@ + +$(BUILD_DIR)/%.o: %.S + @mkdir -p $(dir $@) + @echo " K_AS $<" + @$(CC) $(CFLAGS) -c $< -o $@ + +$(BUILD_DIR)/%.o: %.cc + @mkdir -p $(dir $@) + @echo " K_CXX $<" + @$(CXX) $(CXXFLAGS) -c $< -o $@ + +fs.img: $(UPROGS) + @echo " IMG Generating fs.img (FAT32)" + @dd if=/dev/zero of=fs.img bs=1M count=32 2>/dev/null + @mkfs.vfat -F 32 fs.img >/dev/null + $(foreach prog,$(UPROGS),mcopy -i fs.img $(prog) ::/$(notdir $(prog));) + +run: $(TARGET) fs.img + @echo " QEMU Running..." + @qemu-system-riscv64 -machine virt -nographic \ + -kernel $(TARGET) -m 128M $(QEMUOPTS) + +debug: $(TARGET) fs.img + @echo " QEMU (DEBUG) Waiting for GDB..." + @qemu-system-riscv64 -machine virt -nographic \ + -kernel $(TARGET) -m 128M -s -S $(QEMUOPTS) + +clean: + rm -rf $(BUILD_DIR) fs.img
\ No newline at end of file diff --git a/include/common/fcntl.h b/lume-legacy/include/common/fcntl.h index 6059538..6059538 100644 --- a/include/common/fcntl.h +++ b/lume-legacy/include/common/fcntl.h diff --git a/include/common/types.h b/lume-legacy/include/common/types.h index aa2cb08..aa2cb08 100644 --- a/include/common/types.h +++ b/lume-legacy/include/common/types.h diff --git a/include/drivers/plic.h b/lume-legacy/include/drivers/plic.h index cdcd0ce..cdcd0ce 100644 --- a/include/drivers/plic.h +++ b/lume-legacy/include/drivers/plic.h diff --git a/include/drivers/uart.h b/lume-legacy/include/drivers/uart.h index a56624c..a56624c 100644 --- a/include/drivers/uart.h +++ b/lume-legacy/include/drivers/uart.h diff --git a/include/drivers/uart_color.h b/lume-legacy/include/drivers/uart_color.h index 7ecc28b..7ecc28b 100644 --- a/include/drivers/uart_color.h +++ b/lume-legacy/include/drivers/uart_color.h diff --git a/include/drivers/virtio.h b/lume-legacy/include/drivers/virtio.h index 9fda8cf..9fda8cf 100644 --- a/include/drivers/virtio.h +++ b/lume-legacy/include/drivers/virtio.h diff --git a/include/fs/fat32.h b/lume-legacy/include/fs/fat32.h index 63d62ae..63d62ae 100644 --- a/include/fs/fat32.h +++ b/lume-legacy/include/fs/fat32.h diff --git a/include/fs/file.h b/lume-legacy/include/fs/file.h index 9aff1af..9aff1af 100644 --- a/include/fs/file.h +++ b/lume-legacy/include/fs/file.h diff --git a/include/fs/fs.h b/lume-legacy/include/fs/fs.h index b511a84..b511a84 100644 --- a/include/fs/fs.h +++ b/lume-legacy/include/fs/fs.h diff --git a/include/fs/stat.h b/lume-legacy/include/fs/stat.h index e60ae42..e60ae42 100644 --- a/include/fs/stat.h +++ b/lume-legacy/include/fs/stat.h diff --git a/include/kernel/buf.h b/lume-legacy/include/kernel/buf.h index d0d849c..d0d849c 100644 --- a/include/kernel/buf.h +++ b/lume-legacy/include/kernel/buf.h diff --git a/include/kernel/config.h b/lume-legacy/include/kernel/config.h index 49df2ff..49df2ff 100644 --- a/include/kernel/config.h +++ b/lume-legacy/include/kernel/config.h diff --git a/include/kernel/cpu.h b/lume-legacy/include/kernel/cpu.h index 62bdc17..62bdc17 100644 --- a/include/kernel/cpu.h +++ b/lume-legacy/include/kernel/cpu.h diff --git a/include/kernel/elf.h b/lume-legacy/include/kernel/elf.h index 30193d2..30193d2 100644 --- a/include/kernel/elf.h +++ b/lume-legacy/include/kernel/elf.h diff --git a/include/kernel/exec.h b/lume-legacy/include/kernel/exec.h index 304e03f..304e03f 100644 --- a/include/kernel/exec.h +++ b/lume-legacy/include/kernel/exec.h diff --git a/include/kernel/fdt.h b/lume-legacy/include/kernel/fdt.h index 89cbae6..89cbae6 100644 --- a/include/kernel/fdt.h +++ b/lume-legacy/include/kernel/fdt.h diff --git a/include/kernel/mm.h b/lume-legacy/include/kernel/mm.h index e3de09a..e3de09a 100644 --- a/include/kernel/mm.h +++ b/lume-legacy/include/kernel/mm.h diff --git a/include/kernel/pmm.h b/lume-legacy/include/kernel/pmm.h index 261786d..261786d 100644 --- a/include/kernel/pmm.h +++ b/lume-legacy/include/kernel/pmm.h diff --git a/include/kernel/proc.h b/lume-legacy/include/kernel/proc.h index e11dc47..e11dc47 100644 --- a/include/kernel/proc.h +++ b/lume-legacy/include/kernel/proc.h diff --git a/include/kernel/proc_def.h b/lume-legacy/include/kernel/proc_def.h index 50f27d7..50f27d7 100644 --- a/include/kernel/proc_def.h +++ b/lume-legacy/include/kernel/proc_def.h diff --git a/include/kernel/riscv.h b/lume-legacy/include/kernel/riscv.h index 0c586a9..0c586a9 100644 --- a/include/kernel/riscv.h +++ b/lume-legacy/include/kernel/riscv.h diff --git a/include/kernel/runqueue.h b/lume-legacy/include/kernel/runqueue.h index 14704ce..14704ce 100644 --- a/include/kernel/runqueue.h +++ b/lume-legacy/include/kernel/runqueue.h diff --git a/include/kernel/sbi.h b/lume-legacy/include/kernel/sbi.h index a6be5b3..a6be5b3 100644 --- a/include/kernel/sbi.h +++ b/lume-legacy/include/kernel/sbi.h diff --git a/include/kernel/slab.h b/lume-legacy/include/kernel/slab.h index bb7b699..bb7b699 100644 --- a/include/kernel/slab.h +++ b/lume-legacy/include/kernel/slab.h diff --git a/include/kernel/spinlock.h b/lume-legacy/include/kernel/spinlock.h index 1511199..1511199 100644 --- a/include/kernel/spinlock.h +++ b/lume-legacy/include/kernel/spinlock.h diff --git a/include/kernel/sync.h b/lume-legacy/include/kernel/sync.h index 7f7c208..7f7c208 100644 --- a/include/kernel/sync.h +++ b/lume-legacy/include/kernel/sync.h diff --git a/include/kernel/syscall.h b/lume-legacy/include/kernel/syscall.h index 3594c08..3594c08 100644 --- a/include/kernel/syscall.h +++ b/lume-legacy/include/kernel/syscall.h diff --git a/include/kernel/timer.h b/lume-legacy/include/kernel/timer.h index 8b97bbe..8b97bbe 100644 --- a/include/kernel/timer.h +++ b/lume-legacy/include/kernel/timer.h diff --git a/include/kernel/trap.h b/lume-legacy/include/kernel/trap.h index ddc1d12..ddc1d12 100644 --- a/include/kernel/trap.h +++ b/lume-legacy/include/kernel/trap.h diff --git a/include/lib/errno.h b/lume-legacy/include/lib/errno.h index f0c1436..f0c1436 100644 --- a/include/lib/errno.h +++ b/lume-legacy/include/lib/errno.h diff --git a/include/lib/string.h b/lume-legacy/include/lib/string.h index 6a74942..6a74942 100644 --- a/include/lib/string.h +++ b/lume-legacy/include/lib/string.h diff --git a/include/ulib/assert.h b/lume-legacy/include/ulib/assert.h index 014be9b..014be9b 100644 --- a/include/ulib/assert.h +++ b/lume-legacy/include/ulib/assert.h diff --git a/include/ulib/cstdlib b/lume-legacy/include/ulib/cstdlib index 8b07338..8b07338 100644 --- a/include/ulib/cstdlib +++ b/lume-legacy/include/ulib/cstdlib diff --git a/include/ulib/cstring b/lume-legacy/include/ulib/cstring index d65dc8d..d65dc8d 100644 --- a/include/ulib/cstring +++ b/lume-legacy/include/ulib/cstring diff --git a/include/ulib/ctypes.h b/lume-legacy/include/ulib/ctypes.h index 1ec204e..1ec204e 100644 --- a/include/ulib/ctypes.h +++ b/lume-legacy/include/ulib/ctypes.h diff --git a/include/ulib/cxx.cc b/lume-legacy/include/ulib/cxx.cc index f454fea..f454fea 100644 --- a/include/ulib/cxx.cc +++ b/lume-legacy/include/ulib/cxx.cc diff --git a/include/ulib/errno.h b/lume-legacy/include/ulib/errno.h index dd51598..dd51598 100644 --- a/include/ulib/errno.h +++ b/lume-legacy/include/ulib/errno.h diff --git a/include/ulib/iostream b/lume-legacy/include/ulib/iostream index b05f603..b05f603 100644 --- a/include/ulib/iostream +++ b/lume-legacy/include/ulib/iostream diff --git a/include/ulib/limits.h b/lume-legacy/include/ulib/limits.h index b317e6a..b317e6a 100644 --- a/include/ulib/limits.h +++ b/lume-legacy/include/ulib/limits.h diff --git a/include/ulib/stb_sprintf.h b/lume-legacy/include/ulib/stb_sprintf.h index 00dc123..00dc123 100644 --- a/include/ulib/stb_sprintf.h +++ b/lume-legacy/include/ulib/stb_sprintf.h diff --git a/include/ulib/stdio.h b/lume-legacy/include/ulib/stdio.h index a6df21d..a6df21d 100644 --- a/include/ulib/stdio.h +++ b/lume-legacy/include/ulib/stdio.h diff --git a/include/ulib/stdlib.h b/lume-legacy/include/ulib/stdlib.h index 6d8f75d..6d8f75d 100644 --- a/include/ulib/stdlib.h +++ b/lume-legacy/include/ulib/stdlib.h diff --git a/include/ulib/string.h b/lume-legacy/include/ulib/string.h index c7519ea..c7519ea 100644 --- a/include/ulib/string.h +++ b/lume-legacy/include/ulib/string.h diff --git a/include/ulib/types.h b/lume-legacy/include/ulib/types.h index 69ee233..69ee233 100644 --- a/include/ulib/types.h +++ b/lume-legacy/include/ulib/types.h diff --git a/include/user/user.h b/lume-legacy/include/user/user.h index 7af8bdd..7af8bdd 100644 --- a/include/user/user.h +++ b/lume-legacy/include/user/user.h diff --git a/linker.ld b/lume-legacy/linker.ld index 3a51718..3a51718 100644 --- a/linker.ld +++ b/lume-legacy/linker.ld diff --git a/src/boot/entry.S b/lume-legacy/src/boot/entry.S index 8910ddc..8910ddc 100644 --- a/src/boot/entry.S +++ b/lume-legacy/src/boot/entry.S diff --git a/src/drivers/plic.cc b/lume-legacy/src/drivers/plic.cc index a975c44..a975c44 100644 --- a/src/drivers/plic.cc +++ b/lume-legacy/src/drivers/plic.cc diff --git a/src/drivers/uart.cc b/lume-legacy/src/drivers/uart.cc index 397a402..397a402 100644 --- a/src/drivers/uart.cc +++ b/lume-legacy/src/drivers/uart.cc diff --git a/src/drivers/virtio_dist.cc b/lume-legacy/src/drivers/virtio_dist.cc index 8292874..8292874 100644 --- a/src/drivers/virtio_dist.cc +++ b/lume-legacy/src/drivers/virtio_dist.cc diff --git a/src/fs/fat32.cc b/lume-legacy/src/fs/fat32.cc index e4089d4..e4089d4 100644 --- a/src/fs/fat32.cc +++ b/lume-legacy/src/fs/fat32.cc diff --git a/src/fs/file.cc b/lume-legacy/src/fs/file.cc index d814332..d814332 100644 --- a/src/fs/file.cc +++ b/lume-legacy/src/fs/file.cc diff --git a/src/fs/fs.cc b/lume-legacy/src/fs/fs.cc index fc8f555..fc8f555 100644 --- a/src/fs/fs.cc +++ b/lume-legacy/src/fs/fs.cc diff --git a/src/kernel/bio.cc b/lume-legacy/src/kernel/bio.cc index 5f1aae9..5f1aae9 100644 --- a/src/kernel/bio.cc +++ b/lume-legacy/src/kernel/bio.cc diff --git a/src/kernel/config.cc b/lume-legacy/src/kernel/config.cc index 36858a1..36858a1 100644 --- a/src/kernel/config.cc +++ b/lume-legacy/src/kernel/config.cc diff --git a/src/kernel/cxx.cc b/lume-legacy/src/kernel/cxx.cc index 00f2799..00f2799 100644 --- a/src/kernel/cxx.cc +++ b/lume-legacy/src/kernel/cxx.cc diff --git a/src/kernel/fdt.cc b/lume-legacy/src/kernel/fdt.cc index ae09c84..ae09c84 100644 --- a/src/kernel/fdt.cc +++ b/lume-legacy/src/kernel/fdt.cc diff --git a/src/kernel/initcode.S b/lume-legacy/src/kernel/initcode.S index 22e55ca..22e55ca 100644 --- a/src/kernel/initcode.S +++ b/lume-legacy/src/kernel/initcode.S diff --git a/src/kernel/main.cc b/lume-legacy/src/kernel/main.cc index 6a19915..6a19915 100644 --- a/src/kernel/main.cc +++ b/lume-legacy/src/kernel/main.cc diff --git a/src/kernel/mm/pmm.cc b/lume-legacy/src/kernel/mm/pmm.cc index d3d99ba..d3d99ba 100644 --- a/src/kernel/mm/pmm.cc +++ b/lume-legacy/src/kernel/mm/pmm.cc diff --git a/src/kernel/mm/slab.cc b/lume-legacy/src/kernel/mm/slab.cc index 3bb6b1b..3bb6b1b 100644 --- a/src/kernel/mm/slab.cc +++ b/lume-legacy/src/kernel/mm/slab.cc diff --git a/src/kernel/mm/vm.cc b/lume-legacy/src/kernel/mm/vm.cc index be2f2f2..be2f2f2 100644 --- a/src/kernel/mm/vm.cc +++ b/lume-legacy/src/kernel/mm/vm.cc diff --git a/src/kernel/proc/exec.cc b/lume-legacy/src/kernel/proc/exec.cc index 8d8c467..8d8c467 100644 --- a/src/kernel/proc/exec.cc +++ b/lume-legacy/src/kernel/proc/exec.cc diff --git a/src/kernel/proc/proc.cc b/lume-legacy/src/kernel/proc/proc.cc index 3923fe8..3923fe8 100644 --- a/src/kernel/proc/proc.cc +++ b/lume-legacy/src/kernel/proc/proc.cc diff --git a/src/kernel/proc/swtch.S b/lume-legacy/src/kernel/proc/swtch.S index d55c03e..d55c03e 100644 --- a/src/kernel/proc/swtch.S +++ b/lume-legacy/src/kernel/proc/swtch.S diff --git a/src/kernel/sbi.cc b/lume-legacy/src/kernel/sbi.cc index 5ae7edb..5ae7edb 100644 --- a/src/kernel/sbi.cc +++ b/lume-legacy/src/kernel/sbi.cc diff --git a/src/kernel/spinlock.cc b/lume-legacy/src/kernel/spinlock.cc index aadce21..aadce21 100644 --- a/src/kernel/spinlock.cc +++ b/lume-legacy/src/kernel/spinlock.cc diff --git a/src/kernel/syscall.cc b/lume-legacy/src/kernel/syscall.cc index 0979c24..0979c24 100644 --- a/src/kernel/syscall.cc +++ b/lume-legacy/src/kernel/syscall.cc diff --git a/src/kernel/timer.cc b/lume-legacy/src/kernel/timer.cc index fc02f27..fc02f27 100644 --- a/src/kernel/timer.cc +++ b/lume-legacy/src/kernel/timer.cc diff --git a/src/kernel/trap/handler.cc b/lume-legacy/src/kernel/trap/handler.cc index b7bd5f0..b7bd5f0 100644 --- a/src/kernel/trap/handler.cc +++ b/lume-legacy/src/kernel/trap/handler.cc diff --git a/src/kernel/trap/trampoline.S b/lume-legacy/src/kernel/trap/trampoline.S index 57d6f25..57d6f25 100644 --- a/src/kernel/trap/trampoline.S +++ b/lume-legacy/src/kernel/trap/trampoline.S diff --git a/src/kernel/trap/trap.S b/lume-legacy/src/kernel/trap/trap.S index 8bce53d..8bce53d 100644 --- a/src/kernel/trap/trap.S +++ b/lume-legacy/src/kernel/trap/trap.S diff --git a/src/lib/string.cc b/lume-legacy/src/lib/string.cc index e8eccb3..e8eccb3 100644 --- a/src/lib/string.cc +++ b/lume-legacy/src/lib/string.cc diff --git a/src/ulib/assert.c b/lume-legacy/src/ulib/assert.c index c60643a..c60643a 100644 --- a/src/ulib/assert.c +++ b/lume-legacy/src/ulib/assert.c diff --git a/src/ulib/cxx.cc b/lume-legacy/src/ulib/cxx.cc index d8f510d..d8f510d 100644 --- a/src/ulib/cxx.cc +++ b/lume-legacy/src/ulib/cxx.cc diff --git a/src/ulib/iostream.cpp b/lume-legacy/src/ulib/iostream.cpp index 4d721c1..4d721c1 100644 --- a/src/ulib/iostream.cpp +++ b/lume-legacy/src/ulib/iostream.cpp diff --git a/src/ulib/stdio.c b/lume-legacy/src/ulib/stdio.c index e81f69a..e81f69a 100644 --- a/src/ulib/stdio.c +++ b/lume-legacy/src/ulib/stdio.c diff --git a/src/ulib/stdlib.c b/lume-legacy/src/ulib/stdlib.c index 8b22b6f..8b22b6f 100644 --- a/src/ulib/stdlib.c +++ b/lume-legacy/src/ulib/stdlib.c diff --git a/src/ulib/string.c b/lume-legacy/src/ulib/string.c index c3dbe9a..c3dbe9a 100644 --- a/src/ulib/string.c +++ b/lume-legacy/src/ulib/string.c diff --git a/src/ulib/syscalls.c b/lume-legacy/src/ulib/syscalls.c index 676bf18..676bf18 100644 --- a/src/ulib/syscalls.c +++ b/lume-legacy/src/ulib/syscalls.c diff --git a/src/user/cat.cc b/lume-legacy/src/user/cat.cc index b518d77..b518d77 100644 --- a/src/user/cat.cc +++ b/lume-legacy/src/user/cat.cc diff --git a/src/user/cp.cc b/lume-legacy/src/user/cp.cc index ca35e82..ca35e82 100644 --- a/src/user/cp.cc +++ b/lume-legacy/src/user/cp.cc diff --git a/src/user/echo.cc b/lume-legacy/src/user/echo.cc index cc9dc2a..cc9dc2a 100644 --- a/src/user/echo.cc +++ b/lume-legacy/src/user/echo.cc diff --git a/src/user/entry.S b/lume-legacy/src/user/entry.S index 41e0964..41e0964 100644 --- a/src/user/entry.S +++ b/lume-legacy/src/user/entry.S diff --git a/src/user/grep.cc b/lume-legacy/src/user/grep.cc index 1e1c42d..1e1c42d 100644 --- a/src/user/grep.cc +++ b/lume-legacy/src/user/grep.cc diff --git a/src/user/init.cc b/lume-legacy/src/user/init.cc index 376e697..376e697 100644 --- a/src/user/init.cc +++ b/lume-legacy/src/user/init.cc diff --git a/src/user/kill.cc b/lume-legacy/src/user/kill.cc index d38cdd6..d38cdd6 100644 --- a/src/user/kill.cc +++ b/lume-legacy/src/user/kill.cc diff --git a/src/user/ln.cc b/lume-legacy/src/user/ln.cc index a21ddf9..a21ddf9 100644 --- a/src/user/ln.cc +++ b/lume-legacy/src/user/ln.cc diff --git a/src/user/ls.cc b/lume-legacy/src/user/ls.cc index c44c799..c44c799 100644 --- a/src/user/ls.cc +++ b/lume-legacy/src/user/ls.cc diff --git a/src/user/mkdir.cc b/lume-legacy/src/user/mkdir.cc index 6da8b49..6da8b49 100644 --- a/src/user/mkdir.cc +++ b/lume-legacy/src/user/mkdir.cc diff --git a/src/user/mv.cc b/lume-legacy/src/user/mv.cc index a196145..a196145 100644 --- a/src/user/mv.cc +++ b/lume-legacy/src/user/mv.cc diff --git a/src/user/rm.cc b/lume-legacy/src/user/rm.cc index 4777ade..4777ade 100644 --- a/src/user/rm.cc +++ b/lume-legacy/src/user/rm.cc diff --git a/src/user/sh.cc b/lume-legacy/src/user/sh.cc index 47aad9e..47aad9e 100644 --- a/src/user/sh.cc +++ b/lume-legacy/src/user/sh.cc diff --git a/src/user/touch.cc b/lume-legacy/src/user/touch.cc index 2f9f9f6..2f9f9f6 100644 --- a/src/user/touch.cc +++ b/lume-legacy/src/user/touch.cc diff --git a/src/user/user.ld b/lume-legacy/src/user/user.ld index f0a4b27..f0a4b27 100644 --- a/src/user/user.ld +++ b/lume-legacy/src/user/user.ld diff --git a/src/user/usys.S b/lume-legacy/src/user/usys.S index 1e373d3..1e373d3 100644 --- a/src/user/usys.S +++ b/lume-legacy/src/user/usys.S diff --git a/src/user/wc.cc b/lume-legacy/src/user/wc.cc index fbe9735..fbe9735 100644 --- a/src/user/wc.cc +++ b/lume-legacy/src/user/wc.cc diff --git a/na/mm/memblock.cc b/mm/memblock.cc index aee0245..aee0245 100644 --- a/na/mm/memblock.cc +++ b/mm/memblock.cc diff --git a/na/mm/module.mk b/mm/module.mk index 93cef80..93cef80 100644 --- a/na/mm/module.mk +++ b/mm/module.mk diff --git a/na/mm/page_cache.cc b/mm/page_cache.cc index 25c6a60..25c6a60 100644 --- a/na/mm/page_cache.cc +++ b/mm/page_cache.cc diff --git a/na/mm/slab.cc b/mm/slab.cc index 43d8c4a..43d8c4a 100644 --- a/na/mm/slab.cc +++ b/mm/slab.cc diff --git a/na/Makefile b/na/Makefile deleted file mode 100644 index 88689f5..0000000 --- a/na/Makefile +++ /dev/null @@ -1,419 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (C) 2026 Richard Qin -# -# LumeOS Kernel Makefile (Non-Recursive) -# -# Usage: -# make - Build kernel ELF -# make run - Run in QEMU -# make debug - Run in QEMU with GDB server -# make clean - Clean build artifacts -# make fmt - Format all source files -# make disasm - Generate disassembly listing -# -# Reference: docs/specs/00_conventions.md §7 - -# ============================================================ -# Build Configuration -# ============================================================ -BUILD := build - -# Make sure `make` with no arguments builds the kernel image, not the -# first rule encountered during makefile parsing. scripts/Kconfig.mk -# (included next) defines `defconfig:` at the top of its rule list, -# which would otherwise become the default goal and silently overwrite -# .config from arch/$(ARCH)/defconfig. -.DEFAULT_GOAL := all - -# Load Kbuild helpers (Q, $(call cmd,...), quiet_cmd_* / cmd_* templates, -# kbuild-objs translator). Must come before Kconfig.mk so subsequent -# rules can use $(call cmd,...) immediately. -include scripts/Kbuild.include - -# Load Kconfig infrastructure (reads .config, sets KCPPFLAGS) -include scripts/Kconfig.mk - -ARCH ?= $(CONFIG_ARCH) - -# Two boot products — same pair as Linux RISC-V's arch/riscv/boot/Makefile -# (vmlinux + Image), but named LumeOS-style: -# VMLUME -> build/vmlume.elf : ELF with .symtab/PT_DYNAMIC/.rela.dyn -# IMAGE -> build/vmlume.bin : raw binary (objcopy -O binary) -VMLUME := $(BUILD)/vmlume.elf -IMAGE := $(BUILD)/vmlume.bin - -# Initramfs paths -INITRAMFS_DIR := $(BUILD)/initramfs -INITRAMFS_CPIO := $(BUILD)/initramfs.cpio -INITRAMFS_OBJ := $(BUILD)/initramfs.o -USR_INIT_ELF := $(BUILD)/usr/init -# Relocations: linker emits .rela.dyn under -shared -Bsymbolic; boot -# code in arch/riscv/mm/init.cc::relocate_kernel walks it at startup. -LDS_SRC := arch/$(ARCH)/kernel/lumeos.lds.S -LINKER_SCRIPT := $(BUILD)/lumeos.lds -PYTHON ?= python3 - -# ============================================================ -# Toolchain Detection -# ============================================================ -ifndef TOOLCHAIN_PREFIX -ifeq ($(ARCH),riscv) - # Prefer the linux-gnu toolchain — it supports -shared / -pie which - # are required to emit .rela.dyn (Linux RISC-V kernel uses the same). - # The bare-metal `riscv64-unknown-elf-` is kept only as a last-resort - # fallback; with that one, `-shared` fails ("not supported") and the - # kernel can't relocate at runtime. - TOOLCHAIN_PREFIX := $(shell \ - if command -v riscv64-unknown-linux-gnu-g++ >/dev/null 2>&1; then \ - echo riscv64-unknown-linux-gnu-; \ - elif command -v riscv64-linux-gnu-g++ >/dev/null 2>&1; then \ - echo riscv64-linux-gnu-; \ - else \ - echo riscv64-unknown-linux-gnu-; \ - fi) -else ifeq ($(ARCH),aarch64) - TOOLCHAIN_PREFIX := aarch64-linux-gnu- -else ifeq ($(ARCH),x86_64) - TOOLCHAIN_PREFIX := x86_64-linux-gnu- -endif -endif - -CC := $(TOOLCHAIN_PREFIX)gcc -CXX := $(TOOLCHAIN_PREFIX)g++ -LD := $(TOOLCHAIN_PREFIX)ld -OBJCOPY := $(TOOLCHAIN_PREFIX)objcopy -OBJDUMP := $(TOOLCHAIN_PREFIX)objdump -# Objcopy output formats for binary-to-ELF relocation blob -OBJCOPY_ELF_riscv := elf64-littleriscv -OBJCOPY_ELF_aarch64 := elf64-littleaarch64 -OBJCOPY_ELF_x86_64 := elf64-x86-64 -OBJCOPY_ELF := $(OBJCOPY_ELF_$(ARCH)) - -OBJCOPY_BINARCH_riscv := riscv -OBJCOPY_BINARCH_aarch64 := aarch64 -OBJCOPY_BINARCH_x86_64 := i386:x86-64 -OBJCOPY_BINARCH := $(OBJCOPY_BINARCH_$(ARCH)) - -# Common flags (base, before module includes) -WARNINGS := -Wall -Wextra -Wno-unused-parameter -INCLUDES := -Iinclude -I. - -# ============================================================ -# Source Collection (Non-Recursive Module Fragments) -# Module .mk files may append to SRCS_CC, SRCS_S, INCLUDES -# ============================================================ -SRCS_CC := -SRCS_C := -SRCS_S := -SRCS_s := - --include arch/$(ARCH)/module.mk -include kernel/module.mk -include mm/module.mk -include fs/module.mk -include drivers/base/module.mk -include drivers/module.mk -include drivers/tty/module.mk -include fdt/module.mk -include lib/module.mk -include test/module.mk - -# Compiler flags (defined AFTER includes so INCLUDES is complete) -CFLAGS := $(WARNINGS) -O2 -g \ - -ffreestanding -nostdlib \ - -mcmodel=medany \ - -fPIE \ - -MMD -MP \ - $(KCPPFLAGS) \ - $(INCLUDES) \ - -I$(BUILD)/generated - -# -fPIE makes the compiler emit position-independent code (PC-relative -# addressing + GOT for globals), which is what `-shared` linking expects. -# Mirrors Linux's arch/riscv/Makefile under CONFIG_RELOCATABLE=y: -# KBUILD_CFLAGS += -fPIE - -# C flags for musl libc sources: add libc-shim headers first -CFLAGS_LIBC := $(CFLAGS) -Iinclude/libc-shim \ - -Wno-parentheses -Wno-sign-compare - -CXXFLAGS := $(CFLAGS) \ - -std=c++17 \ - -fno-exceptions -fno-rtti -fno-use-cxa-atexit \ - -fno-threadsafe-statics - -# Assembler flags MUST NOT include -fPIE. -# Linux's arch/riscv/Makefile adds -fPIE only to KBUILD_CFLAGS, NOT to -# KBUILD_AFLAGS: with -fPIE the gcc driver puts the assembler in PIC -# mode, where the `la` macro silently expands to a GOT-indirect load -# (`auipc + ld` reading a slot that holds the link-time VA). In our -# pre-MMU boot path that VA is unmapped, so any `la sym, sym` faults -# and reboots into a `_start` loop. Stripping -fPIE makes `la` emit -# direct PC-relative addressing (`auipc + addi`) which works at PA. -ASFLAGS := $(filter-out -fPIE,$(CFLAGS)) - -# Link as a position-independent shared object so the linker emits -# `.rela.dyn` with R_RISCV_RELATIVE entries that the boot stub applies -# at load time. Mirrors Linux's arch/riscv/Makefile §10: -# LDFLAGS_vmlinux += -shared -Bsymbolic -z notext -# `-Bsymbolic` resolves all global refs at link time (no dynamic -# resolution); `-z notext` lets us keep relocations in code pages. -LDFLAGS := -nostdlib -shared -Bsymbolic -z notext -z norelro --no-dynamic-linker - -# ============================================================ -# Object File Computation -# ============================================================ -OBJS := $(patsubst %.cc,$(BUILD)/%.o,$(SRCS_CC)) \ - $(patsubst %.c,$(BUILD)/%.o,$(SRCS_C)) \ - $(patsubst %.S,$(BUILD)/%.o,$(SRCS_S)) \ - $(patsubst %.s,$(BUILD)/%.o,$(SRCS_s)) - -DEPS := $(OBJS:.o=.d) - -# ============================================================ -# Build Rules -# ============================================================ -.PHONY: all clean run debug fmt disasm defconfig savedefconfig showconfig - -all: $(VMLUME) $(IMAGE) - -# Generate autoconf.h before any compilation -$(AUTOCONF_H): scripts/Kconfig.mk $(wildcard .config) - $(generate-autoconf) - -# ============================================================ -# Generated header: asm-offsets.h -# -# Linux-style trick (mirrors include/linux/kbuild.h + arch/*/kernel/ -# asm-offsets.c + scripts/Makefile.build): compile asm-offsets.c to -# assembly, scrape the magic `->SYM val` markers produced by the -# DEFINE/OFFSET inline-asm macros, rewrite them into `#define` -# directives via sed. head.S and friends then `#include -# <generated/asm-offsets.h>` to access struct field offsets without -# having to hand-maintain them — re-order a struct field, the -# generated constant follows. -# ============================================================ -ASM_OFFSETS_C := arch/$(ARCH)/kernel/asm-offsets.c -ASM_OFFSETS_S := $(BUILD)/arch/$(ARCH)/kernel/asm-offsets.s -ASM_OFFSETS_H := $(BUILD)/generated/asm-offsets.h -ASM_OFFSETS_SED := scripts/extract-asm-offsets.sed - -# Compile asm-offsets.c to *.s only — we never want the .o linked in. -$(ASM_OFFSETS_S): $(ASM_OFFSETS_C) $(AUTOCONF_H) - @echo " CC -S $<" - @mkdir -p $(dir $@) - @$(CC) $(CFLAGS_LIBC) -S $< -o $@ - -# Rewrite ->NAME markers into #define lines. Header guard hand-rolled -# at the top, sed body in the middle, closing #endif at the bottom. -$(ASM_OFFSETS_H): $(ASM_OFFSETS_S) $(ASM_OFFSETS_SED) - @echo " GEN $@" - @mkdir -p $(dir $@) - @(echo "/* AUTO-GENERATED — DO NOT EDIT */"; \ - echo "/* Generated from $(ASM_OFFSETS_C) by scripts/extract-asm-offsets.sed */"; \ - echo "#ifndef _LUME_GENERATED_ASM_OFFSETS_H"; \ - echo "#define _LUME_GENERATED_ASM_OFFSETS_H"; \ - echo ""; \ - sed -n -f $(ASM_OFFSETS_SED) $<; \ - echo ""; \ - echo "#endif /* _LUME_GENERATED_ASM_OFFSETS_H */") > $@ - -# All objects depend on autoconf.h and asm-offsets.h -$(OBJS): $(AUTOCONF_H) $(ASM_OFFSETS_H) - -# ============================================================ -# Generic %.pi.o post-processing rule -# -# Mirrors arch/riscv/kernel/pi/Makefile §26-30 in Linux: -# -# $(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ -# --remove-section=.note.gnu.property -# --prefix-alloc-sections=.init.pi -# $(obj)/%.pi.o: $(obj)/%.o FORCE -# $(call if_changed,objcopy) -# -# Purpose: take a regular .o produced by the normal compile rule and -# rewrite it so the early position-independent code can coexist with -# the rest of the kernel without symbol clashes: -# -# --prefix-symbols=__pi_ Every global symbol becomes __pi_<name>. -# head.S calls them as __pi_fdt_path_offset -# etc., keeping the pre-MMU namespace -# cleanly isolated. -# -# --prefix-alloc-sections=.init.pi -# All SHF_ALLOC sections get re-prefixed -# so they land in .init.pi in vmlinux.lds.S, -# which positions them where the boot -# loader has already mapped memory. -# -# --remove-section=.note.gnu.property -# Discarded because post-rename it can -# confuse the linker about ELF features. -# -# Generic pattern (`$(BUILD)/%.pi.o`) so any subdir's source can opt in -# by listing a `.pi.o` target in its SRCS. The companion compile-side -# CFLAGS overrides (replacing -fPIE with -fpie, adding -Os, etc.) are -# expected to come from the subdir's own .mk fragment via target- -# specific CFLAGS_LIBC / CXXFLAGS overrides. -# ============================================================ -$(BUILD)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \ - --remove-section=.note.gnu.property \ - --prefix-alloc-sections=.init.pi - -$(BUILD)/%.pi.o: $(BUILD)/%.o - $(call cmd,objcopy) - -# Preprocess linker script template (.lds.S → .lds) -$(LINKER_SCRIPT): $(LDS_SRC) include/lume/lumeos.lds.h - @echo " LDS $@" - @mkdir -p $(dir $@) - @$(CC) -E -P -x c $(INCLUDES) $< -o $@ - -# ============================================================ -# Initramfs: pack a root filesystem into a newc cpio. -# -# Pipeline mirrors Linux's Kbuild: -# usr/gen_init_cpio — host C tool, produces cpio bytes -# scripts/gen_initramfs.sh — wrapper that prepares the listing, -# handles directories vs. listing files, -# applies uid/gid remap, then invokes the -# host tool. -# Sourced from $(CONFIG_INITRAMFS_SOURCE) — see scripts/Kconfig.mk. -# ============================================================ - -# Host compiler — distinct from $(CC), which may be the cross compiler. -HOSTCC ?= cc -HOSTCFLAGS ?= -O2 -Wall - -# Output path matches Linux convention (usr/gen_init_cpio) so the -# verbatim copy of scripts/gen_initramfs.sh from Linux finds it via its -# hardcoded relative path when invoked from the kernel source root. -GEN_INIT_CPIO := usr/gen_init_cpio - -$(GEN_INIT_CPIO): usr/gen_init_cpio.c - @echo " HOSTCC $@" - @$(HOSTCC) $(HOSTCFLAGS) -o $@ $< - -INITRAMFS_SOURCE := $(CONFIG_INITRAMFS_SOURCE) - -# Record the chosen source so changing CONFIG_INITRAMFS_SOURCE on the -# command line forces a rebuild — without this, `make` only compares -# file mtimes and would happily reuse a cpio packed from a different -# source as long as that other source isn't newer. Evaluated at -# Makefile parse time so the dep edge is correct from the first rule -# check. Mirrors the idea behind Linux's $(call if_changed,...). -INITRAMFS_SRC_STAMP := $(BUILD)/.initramfs_src.stamp -$(shell mkdir -p $(BUILD) 2>/dev/null; \ - prev=$$([ -f "$(INITRAMFS_SRC_STAMP)" ] && cat "$(INITRAMFS_SRC_STAMP)" || echo); \ - if [ "$$prev" != "$(INITRAMFS_SOURCE)" ]; then \ - printf '%s\n' "$(INITRAMFS_SOURCE)" > "$(INITRAMFS_SRC_STAMP)"; \ - fi) - -$(INITRAMFS_CPIO): $(INITRAMFS_SOURCE) $(INITRAMFS_SRC_STAMP) \ - $(GEN_INIT_CPIO) scripts/gen_initramfs.sh - @echo " INITRAMFS $(INITRAMFS_SOURCE)" - @mkdir -p $(dir $@) - @./scripts/gen_initramfs.sh -o $@ \ - -u $(CONFIG_INITRAMFS_ROOT_UID) \ - -g $(CONFIG_INITRAMFS_ROOT_GID) \ - $(INITRAMFS_SOURCE) - -$(INITRAMFS_OBJ): $(INITRAMFS_CPIO) - @echo " OBJCOPY $@ (initramfs)" - @$(OBJCOPY) -I binary -O $(OBJCOPY_ELF) -B $(OBJCOPY_BINARCH) \ - --rename-section .data=.init.ramfs,alloc,load,readonly,data,contents \ - $< $@ - -# Single-pass kernel link. With `-shared -Bsymbolic`, the linker -# emits `.rela.dyn` containing R_RISCV_RELATIVE entries directly into -# the output ELF — no separate gen_reloc pass. -$(VMLUME): $(OBJS) $(INITRAMFS_OBJ) $(LINKER_SCRIPT) - @echo " LD $@" - @mkdir -p $(dir $@) - @$(LD) $(LDFLAGS) -T $(LINKER_SCRIPT) -o $@ $(OBJS) $(INITRAMFS_OBJ) - @$(TOOLCHAIN_PREFIX)size $@ - -# Image = raw binary, mirrors Linux's `arch/riscv/boot/Image` (objcopy -# vmlinux to raw bytes, no ELF header — what U-Boot or QEMU's `-bios` -# bare-loading would consume). Linux always builds both vmlinux and -# Image; LumeOS follows the same convention. -$(IMAGE): $(VMLUME) - @echo " OBJCOPY $@" - @$(OBJCOPY) -O binary $< $@ - -# Compile C++ sources. Recipe goes through $(call cmd,...) so that -# `make V=1` echoes the full command line. $(Q) prefix on mkdir keeps -# the directory-creation step silent in quiet mode but visible at V=1. -$(BUILD)/%.o: %.cc - $(Q)mkdir -p $(dir $@) - $(call cmd,cxx_o_cc) - -$(BUILD)/%.o: %.c - $(Q)mkdir -p $(dir $@) - $(call cmd,cc_o_c) - -$(BUILD)/%.o: %.S - $(Q)mkdir -p $(dir $@) - $(call cmd,as_o_S) - -$(BUILD)/%.o: %.s - $(Q)mkdir -p $(dir $@) - $(call cmd,as_o_S) - -# Auto-dependency tracking --include $(DEPS) - -# ============================================================ -# Run & Debug -# ============================================================ -ifeq ($(ARCH),riscv) -QEMU := qemu-system-riscv64 -QEMU_MACHINE := -machine virt -smp 4 -m 128M -nographic -QEMU_BIOS := -bios default -else ifeq ($(ARCH),aarch64) -QEMU := qemu-system-aarch64 -QEMU_MACHINE := -machine virt -cpu cortex-a53 -m 128M -nographic -QEMU_BIOS := -else ifeq ($(ARCH),x86_64) -QEMU := qemu-system-x86_64 -QEMU_MACHINE := -m 128M -nographic -QEMU_BIOS := -endif - -run: $(VMLUME) $(IMAGE) - @echo " QEMU Running..." - $(QEMU) $(QEMU_MACHINE) $(QEMU_BIOS) -kernel $(VMLUME) - -debug: $(VMLUME) $(IMAGE) - @echo " QEMU Waiting for GDB on :1234..." - $(QEMU) $(QEMU_MACHINE) $(QEMU_BIOS) -kernel $(VMLUME) -s -S - -# ============================================================ -# Utilities -# ============================================================ -clean: - rm -rf $(BUILD) - -disasm: $(VMLUME) - @echo " OBJDUMP $<" - @$(OBJDUMP) -d -S $(VMLUME) > $(VMLUME).asm - @echo " Written to $(VMLUME).asm" - -fmt: - @echo " FMT Formatting source files..." - @find . -name '*.cc' -o -name '*.h' | xargs clang-format -i 2>/dev/null || true - -lint: - @echo " LINT Generating compile_commands.json via bear..." - @bear -- $(MAKE) all - @echo " LINT Running clang-tidy on C++ sources..." - @clang-tidy -p . $(SRCS_CC) || true - -# Print build info (for debugging Makefile issues) -info: - @echo "TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX)" - @echo "SRCS_CC = $(SRCS_CC)" - @echo "SRCS_S = $(SRCS_S)" - @echo "OBJS = $(OBJS)" - @echo "KCPPFLAGS = $(KCPPFLAGS)" diff --git a/na/scripts/Kbuild.include b/scripts/Kbuild.include index 76466bd..76466bd 100644 --- a/na/scripts/Kbuild.include +++ b/scripts/Kbuild.include diff --git a/na/scripts/Kconfig.mk b/scripts/Kconfig.mk index 2bdc934..2bdc934 100644 --- a/na/scripts/Kconfig.mk +++ b/scripts/Kconfig.mk diff --git a/na/scripts/dtc/libfdt/fdt.c b/scripts/dtc/libfdt/fdt.c index 56d4dcb..56d4dcb 100644 --- a/na/scripts/dtc/libfdt/fdt.c +++ b/scripts/dtc/libfdt/fdt.c diff --git a/na/scripts/dtc/libfdt/fdt.h b/scripts/dtc/libfdt/fdt.h index a07abfc..a07abfc 100644 --- a/na/scripts/dtc/libfdt/fdt.h +++ b/scripts/dtc/libfdt/fdt.h diff --git a/na/scripts/dtc/libfdt/fdt_addresses.c b/scripts/dtc/libfdt/fdt_addresses.c index c40ba09..c40ba09 100644 --- a/na/scripts/dtc/libfdt/fdt_addresses.c +++ b/scripts/dtc/libfdt/fdt_addresses.c diff --git a/na/scripts/dtc/libfdt/fdt_empty_tree.c b/scripts/dtc/libfdt/fdt_empty_tree.c index 49d54d4..49d54d4 100644 --- a/na/scripts/dtc/libfdt/fdt_empty_tree.c +++ b/scripts/dtc/libfdt/fdt_empty_tree.c diff --git a/na/scripts/dtc/libfdt/fdt_overlay.c b/scripts/dtc/libfdt/fdt_overlay.c index 51a3859..51a3859 100644 --- a/na/scripts/dtc/libfdt/fdt_overlay.c +++ b/scripts/dtc/libfdt/fdt_overlay.c diff --git a/na/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c index 63494fb..63494fb 100644 --- a/na/scripts/dtc/libfdt/fdt_ro.c +++ b/scripts/dtc/libfdt/fdt_ro.c diff --git a/na/scripts/dtc/libfdt/fdt_rw.c b/scripts/dtc/libfdt/fdt_rw.c index 90ea14e..90ea14e 100644 --- a/na/scripts/dtc/libfdt/fdt_rw.c +++ b/scripts/dtc/libfdt/fdt_rw.c diff --git a/na/scripts/dtc/libfdt/fdt_strerror.c b/scripts/dtc/libfdt/fdt_strerror.c index d852b77..d852b77 100644 --- a/na/scripts/dtc/libfdt/fdt_strerror.c +++ b/scripts/dtc/libfdt/fdt_strerror.c diff --git a/na/scripts/dtc/libfdt/fdt_sw.c b/scripts/dtc/libfdt/fdt_sw.c index 4c569ee..4c569ee 100644 --- a/na/scripts/dtc/libfdt/fdt_sw.c +++ b/scripts/dtc/libfdt/fdt_sw.c diff --git a/na/scripts/dtc/libfdt/fdt_wip.c b/scripts/dtc/libfdt/fdt_wip.c index c2d7566..c2d7566 100644 --- a/na/scripts/dtc/libfdt/fdt_wip.c +++ b/scripts/dtc/libfdt/fdt_wip.c diff --git a/na/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h index 81aaf7c..81aaf7c 100644 --- a/na/scripts/dtc/libfdt/libfdt.h +++ b/scripts/dtc/libfdt/libfdt.h diff --git a/na/scripts/dtc/libfdt/libfdt_env.h b/scripts/dtc/libfdt/libfdt_env.h index 5580b48..5580b48 100644 --- a/na/scripts/dtc/libfdt/libfdt_env.h +++ b/scripts/dtc/libfdt/libfdt_env.h diff --git a/na/scripts/dtc/libfdt/libfdt_internal.h b/scripts/dtc/libfdt/libfdt_internal.h index 0e103ca..0e103ca 100644 --- a/na/scripts/dtc/libfdt/libfdt_internal.h +++ b/scripts/dtc/libfdt/libfdt_internal.h diff --git a/na/scripts/extract-asm-offsets.sed b/scripts/extract-asm-offsets.sed index c97ec2c..c97ec2c 100644 --- a/na/scripts/extract-asm-offsets.sed +++ b/scripts/extract-asm-offsets.sed diff --git a/na/scripts/gen_initramfs.sh b/scripts/gen_initramfs.sh index 7eba2fd..7eba2fd 100755 --- a/na/scripts/gen_initramfs.sh +++ b/scripts/gen_initramfs.sh diff --git a/na/test/module.mk b/test/module.mk index 47a693c..47a693c 100644 --- a/na/test/module.mk +++ b/test/module.mk diff --git a/na/test/selftest.cc b/test/selftest.cc index e1bb2b4..e1bb2b4 100644 --- a/na/test/selftest.cc +++ b/test/selftest.cc diff --git a/na/test/test_atomic.cc b/test/test_atomic.cc index 9851e7b..9851e7b 100644 --- a/na/test/test_atomic.cc +++ b/test/test_atomic.cc diff --git a/na/test/test_dcache.cc b/test/test_dcache.cc index 9e0eec5..9e0eec5 100644 --- a/na/test/test_dcache.cc +++ b/test/test_dcache.cc diff --git a/na/test/test_driver_model.cc b/test/test_driver_model.cc index 8f105b3..8f105b3 100644 --- a/na/test/test_driver_model.cc +++ b/test/test_driver_model.cc diff --git a/na/test/test_exec.cc b/test/test_exec.cc index bbfa3b6..bbfa3b6 100644 --- a/na/test/test_exec.cc +++ b/test/test_exec.cc diff --git a/na/test/test_fdt.cc b/test/test_fdt.cc index cf09029..cf09029 100644 --- a/na/test/test_fdt.cc +++ b/test/test_fdt.cc diff --git a/na/test/test_klog.cc b/test/test_klog.cc index 896e7ed..896e7ed 100644 --- a/na/test/test_klog.cc +++ b/test/test_klog.cc diff --git a/na/test/test_mutex.cc b/test/test_mutex.cc index e86c984..e86c984 100644 --- a/na/test/test_mutex.cc +++ b/test/test_mutex.cc diff --git a/na/test/test_namei.cc b/test/test_namei.cc index 8e4ecb0..8e4ecb0 100644 --- a/na/test/test_namei.cc +++ b/test/test_namei.cc diff --git a/na/test/test_page_cache.cc b/test/test_page_cache.cc index ee0e0e2..ee0e0e2 100644 --- a/na/test/test_page_cache.cc +++ b/test/test_page_cache.cc diff --git a/na/test/test_pid.cc b/test/test_pid.cc index e79eb1e..e79eb1e 100644 --- a/na/test/test_pid.cc +++ b/test/test_pid.cc diff --git a/na/test/test_pipe_devfs.cc b/test/test_pipe_devfs.cc index ed375ed..ed375ed 100644 --- a/na/test/test_pipe_devfs.cc +++ b/test/test_pipe_devfs.cc diff --git a/na/test/test_pmm.cc b/test/test_pmm.cc index 3330866..3330866 100644 --- a/na/test/test_pmm.cc +++ b/test/test_pmm.cc diff --git a/na/test/test_random.cc b/test/test_random.cc index d546410..d546410 100644 --- a/na/test/test_random.cc +++ b/test/test_random.cc diff --git a/na/test/test_rbtree.cc b/test/test_rbtree.cc index 27f049a..27f049a 100644 --- a/na/test/test_rbtree.cc +++ b/test/test_rbtree.cc diff --git a/na/test/test_sched.cc b/test/test_sched.cc index d90c30a..d90c30a 100644 --- a/na/test/test_sched.cc +++ b/test/test_sched.cc diff --git a/na/test/test_signal.cc b/test/test_signal.cc index 360b0e6..360b0e6 100644 --- a/na/test/test_signal.cc +++ b/test/test_signal.cc diff --git a/na/test/test_slab.cc b/test/test_slab.cc index 8a448b4..8a448b4 100644 --- a/na/test/test_slab.cc +++ b/test/test_slab.cc diff --git a/na/test/test_smp.cc b/test/test_smp.cc index f934526..f934526 100644 --- a/na/test/test_smp.cc +++ b/test/test_smp.cc diff --git a/na/test/test_spinlock.cc b/test/test_spinlock.cc index be794a0..be794a0 100644 --- a/na/test/test_spinlock.cc +++ b/test/test_spinlock.cc diff --git a/na/test/test_sys_fs_extra.cc b/test/test_sys_fs_extra.cc index 705ce63..705ce63 100644 --- a/na/test/test_sys_fs_extra.cc +++ b/test/test_sys_fs_extra.cc diff --git a/na/test/test_sys_mm.cc b/test/test_sys_mm.cc index 2c1a7dc..2c1a7dc 100644 --- a/na/test/test_sys_mm.cc +++ b/test/test_sys_mm.cc diff --git a/na/test/test_sys_process.cc b/test/test_sys_process.cc index 686bed6..686bed6 100644 --- a/na/test/test_sys_process.cc +++ b/test/test_sys_process.cc diff --git a/na/test/test_trap.cc b/test/test_trap.cc index c91948a..c91948a 100644 --- a/na/test/test_trap.cc +++ b/test/test_trap.cc diff --git a/na/test/test_uaccess.cc b/test/test_uaccess.cc index c5a8c6c..c5a8c6c 100644 --- a/na/test/test_uaccess.cc +++ b/test/test_uaccess.cc diff --git a/na/test/test_vfs_io.cc b/test/test_vfs_io.cc index 3d3b125..3d3b125 100644 --- a/na/test/test_vfs_io.cc +++ b/test/test_vfs_io.cc diff --git a/na/test/test_vma.cc b/test/test_vma.cc index 5278914..5278914 100644 --- a/na/test/test_vma.cc +++ b/test/test_vma.cc diff --git a/na/test/test_vmm.cc b/test/test_vmm.cc index 635e3f3..635e3f3 100644 --- a/na/test/test_vmm.cc +++ b/test/test_vmm.cc diff --git a/na/test/test_waitqueue.cc b/test/test_waitqueue.cc index 7f50d6b..7f50d6b 100644 --- a/na/test/test_waitqueue.cc +++ b/test/test_waitqueue.cc diff --git a/na/usr/default_cpio_list b/usr/default_cpio_list index 6721365..6721365 100644 --- a/na/usr/default_cpio_list +++ b/usr/default_cpio_list diff --git a/na/usr/gen_init_cpio.c b/usr/gen_init_cpio.c index b7296ed..b7296ed 100644 --- a/na/usr/gen_init_cpio.c +++ b/usr/gen_init_cpio.c |
