Repository navigation
Releases
atlOS 0.7.1
Changed
- Documentation site: a description for every page (the site's for the
home page, the first paragraph for the others), a descriptive title for
the home page and Open Graph tags for link previews
(docs/theme/main.html,scripts/mkdocs_hooks.py) - Documentation site: chapters split over two pages are numbered 5.1 and
5.2, 6.1 and 6.2, 10.1 and 10.2, 12.1 and 12.2, as in the tutorial's
overview
Boot it with qemu-system-x86_64 -cdrom atlOS-0.7.1.iso -m 512M -serial stdio.
Build from source: see docs/building.md.
atlOS 0.7.0
Added
- Processes and threads:
Process::Processowns the address space, the
open files and the heap, and holds any number of threads
(Process::UserThread); the scheduler runs every thread in one pool and
does not look at processes. Process 0 is the kernel, its threads the
kernel threads. pids are the lowest free number - Thread ids (
Abi::ThreadId): the pid in the upper 32 bits, the thread's
number in its process in the lower 32 (the main thread is 0) - Thread system calls:
startThread(9),exitThread(10),waitThread
(11),currentThread(12);User::Threading::Threadfor programs with
the same API as the kernel'sThreading::Thread, a trampoline so a thread
may return, and the destructor that waits - Every user thread has a 2 MB stack page with an unmapped 2 MB guard
below it, taken when the thread starts and given back when it is waited
for; a fault in the guard names the thread (stack overflow: thread 1 of pid 3). No limit on threads but memory (-ENOMEM) - A program ends when its main thread ends, on
exitProcessfrom any
thread, or on a fault in any thread: it is marked dying and each thread
ends when it next returns to ring 3 or starts; a sleeping one is woken - Kernel threads:
int64_t entry(void* arg), the return value is the exit
code,Thread::wait(),Thread::id(),Threading::exitThread(code),
Threading::currentThread(); deleting a queued thread waits for it Utils::IntrusiveList(kernel/lib/intrusive_list.hpp): the
scheduler's tasks and the wait queues are linked through the TCBscommon/abi/abi.hpp(Abi::): the system call numbers, errors, open
flags, auxv types and ids, one header for the kernel and user programs- The shell's
pslists the processes (threads, stack pages, open files,
state);tasks,schedandtopshow thread ids aspid.number - User programs
THREADS.ELF,THREXIT.ELF,OVERFLOW.ELF
Changed
- Kernel code is in namespace
Kernel::(Kernel::Memory,
Kernel::Threading, ...); the shared heap isCommon::Heap - User programs are C++17:
user/lib/atlos.hpp(namespaceUser, the
kernel's names:User::Threading::yield,User::Process::exitProcess,
printHex,printNumber,heapInfo), global constructors run before
main,newanddeleteon the heap; the file and console calls keep
their standard C names. The programs are.cppfiles - System calls 0 and 7 are
exitProcessandcurrentProcess - The scheduler and
Sync::WaitQueuehave no limit (were 16 tasks); the
scheduler lists its tasks withfirstTask/nextTask,bootTask,
idleTask - At most 64 programs at once (
Runtime::maxProcesses) - The boot stack is 64 KB
Removed
user/lib/atlos.h,Scheduler::maxTasks,Scheduler::idleIndex,
Scheduler::task(index),Runtime::exitCurrent(nowexitProcess)
Boot it with qemu-system-x86_64 -cdrom atlOS-0.7.0.iso -m 512M -serial stdio.
Build from source: see docs/building.md.
atlOS 0.6.1
Fixed
scripts/make-site.pyandscripts/make-demo-gif.pyare executable in
git: CI could not build the documentation site, and the release of 0.6.0
did not publish it
Boot it with qemu-system-x86_64 -cdrom atlOS-0.6.1.iso -m 512M -serial stdio.
Build from source: see docs/building.md.
atlOS 0.6.0
Added
- The idle thread: every scheduler queues one as task 1; it runs when no
other task can and halts insti; hlt(the scheduler no longer halts on
the caller's stack).Scheduler(TickSource&, AddressSpace&) - CPU time: each tick is charged to the running task (
TCB::cpuTicks),
TCB::runsandScheduler::switchCount()count switches; the shell's
sched(since boot) andtop [ms](over a window) - A heap of atlOS's own (
common/heap/):Memory::Heap, a free list sorted
by address, first fit, split on allocate and merged with free neighbours
on free; whole chunks go back to theirMemory::PageSource. Refuses
pointers it did not hand out and double frees - User programs get a heap:
Runtime::spawn(..., heapSize)maps it behind
the data (2 MB by default, at most 64 MB; the shell'srun -heap MB), the
auxiliary vector says where (AT_PAGESZ,AT_ATLOS_HEAP_BASE,
AT_ATLOS_HEAP_SIZE),atlos_startsets it up beforemain;malloc,
calloc,realloc,freeandheap_infoinatlos.h;MALLOC.ELF - A tutorial (
docs/tutorial.md): the subsystem READMEs in boot order, with a
short introduction (CPU, x86, x86_64, OS) - Documentation site (MkDocs):
scripts/build.sh site, built in CI and
published to GitHub Pages with every release
Changed
docs/memory.mdanddocs/scheduler.mdmerged intokernel/mm/README.md
andkernel/sched/README.md- The kernel heap is a
Memory::HeaponMemory::AddressSpacePages, bound
withMemory::setKernelHeap(wassetHeapAddressSpace);kfreeof a bad
pointer panics;memshows the chunks and free blocks - User programs start in
atlos_start(user/lib/start.cpp), not inmain
directly
Removed
- liballoc 1.1 (the kernel heap is atlOS's own now)
Boot it with qemu-system-x86_64 -cdrom atlOS-0.6.0.iso -m 512M -serial stdio.
Build from source: see docs/building.md.
atlOS 0.5.0
Added
-
PCI and PCIe:
Drivers::PciConfigSpace(ports0xCF8/0xCFC,
PciPortConfigSpace),scanPciover every bus, device and function, the
class, vendor and capability names; the shell'slspcilists the
functions,lspci bus:dev.fndecodes one (BARs, interrupt pin,
capabilities) and dumps its header -
System calls:
read(the keyboard as fd 0, raw; Ctrl+C ends the program
with 130),open(O_RDONLY,O_WRONLY,O_RDWR,O_CREAT,O_TRUNC,
O_APPEND; paths from the root),close,yield,sleep,getpid,
uptime;writeto fd 2 and to files; eight open files per program -
Runtime::wait(pid); user programsASK.ELF,CLOCK.ELF,FILES.ELF;
print_numberand the new calls inatlos.h -
argcandargv:Runtime::spawn(path, argc, argv)writes the System V
start stack (strings,argv[], empty envp and auxv,argcatrsp),
crt0 callsmain(argc, argv);run program.elf [args];ARGS.ELF,
CAT.ELF,print_hex -
ACPI:
Firmware::findRsdp(the multiboot2 tags),Firmware::AcpiTables
(the XSDT or RSDT and their tables, checksums checked),parseMadtand
isaRoute(processors, I/O APICs, interrupt source overrides, NMI pins);
the shell'sacpilists the tables,acpi SIGdecodes and dumps one -
The APIC:
Drivers::LocalApic,Drivers::IoApic,
Drivers::ApicInterruptController(the ISA IRQs routed as the MADT says,
vectors0x20 + irq) andDrivers::ApicTimer(measured against the PIT,
1 ms periodic on vector0x40); the shell'sapicshows the registers and
the routes -
AddressSpace::mapDevice(uncached MMIO mappings),Drivers::pitBusyWait
(PIT channel 2, polled) -
SMBIOS 2.x:
Firmware::findSmbios(the BIOS area,_SM_and_DMI_
checked; a_SM3_is reported, not read),SmbiosTables(a walk bounded
by the table length),SmbiosStructure(fields beyond the length read as
0, strings by number), decoders for types 0, 1, 2, 4 and 17; the shell's
smbios [type] -
Self tests for the scan,
lspci, the system calls, the arguments, the ACPI
tables, the MADT, the APIC and SMBIOS (882 checks); the shell test types
into a program and reads the APIC and SMBIOS (52 steps) -
An animated GIF of the boot and the shell at the top of the README
(scripts/make-demo-gif.py)
Changed
- The banner puts the version and the description on two lines (a
development build'sgit describemade it wrap) runwaits until the program exits; the keys typed meanwhile go to the
program- With ACPI the IRQs arrive through the I/O APIC and the scheduler ticks on
the local APIC timer; the 8259 PIC stays masked. Without ACPI the PIC and
the PIT are used as before
Removed
- The old SMBIOS code (
firmware/bios/, the types 3, 16, 19, 32 and 127
classes), which was not called and read the structures in a fixed order
Boot it with qemu-system-x86_64 -cdrom atlOS-0.5.0.iso -m 512M -serial stdio.
Build from source: see docs/building.md.
atlOS 0.4.0
Added
- Shell commands for the hardware:
cr(CR0, CR2, CR3, CR4, EFER by bit),
rdmsr/wrmsr,in/out(8, 16, 32 bit),gdt,idt [vector],
pt addr(the page table walk),irq(interrupts per vector) - The exception table (
.extable,Fault::fixup):readMsr,writeMsr
andreadQwordfault without a panic and return false IDT::interruptCount,AddressSpace::walk,IOPort::inportl/outportl- The shell's
int vector(IDT::raise): any vector in software; the
vectors with an error code get a hand built frame - Breakpoints report and continue:
int3in the kernel prints the registers
and a backtrace, in ring 3 the registers;ATLOS_BREAKPOINT()for kernel
code,breakpoint()andBREAK.ELFfor user programs - The shell's
disklists the disks and partitions (Fs::BlockDeviceList,
filled at boot);disk read lba [count] [device]dumps sectors in hex - Self tests for the exception table, the walk, the counts, raising, the
breakpoints and the commands (760 checks); the shell test runs them
(37 steps)
Changed
-
helpshows the commands by group (general, files, memory, tasks, cpu,
devices, system);help groupandhelp commandshow their usage -
QEMU emulates the same CPU everywhere: an Intel Skylake
(Skylake-Client-v1) without the features its emulator lacks, in
scripts/qemu-cpu: run, debug, the tests and the screenshots -
cpuinfo(printCPUInfo): one value per line, the family and model as
the CPU means them (with the extended fields), only the features the CPU
has, with their Linux names, wrapped to 80 columns, and the cache sizes -
No scheduler handed in:
Threading::currentTask()(set on every
switch) andTCB::schedulerletWaitQueue,Semaphore(initial, max),
Mutex,ConditionVariableandCharacterQueuebe created without a
scheduler;Thread(entry)uses the caller's scheduler and the kernel
address space; thread entry points arevoid()and use
Threading::yield(),sleep(ms),exitThread();Process::Runtimeand
Shell::Contextno longer take the scheduler
Fixed
-
strncmpcompared anintcounter with thesize_tlength (a
-Wsign-comparewarning on every build); libc warnings are now errors, as
in the kernel -
scripts/build.sh runfailed with "mcopy: not found" on a machine without
mtools: the test disk tools are now looked up on every configure (no cached
paths), the disk script uses the ones CMake found and says which are
missing, and without themrunanddebugboot without a disk;
scripts/build.shconfigures every time, so installing a tool takes effect
at once
Boot it with qemu-system-x86_64 -cdrom atlOS-0.4.0.iso -m 512M -serial stdio.
Build from source: see docs/building.md.
atlOS 0.3.0
User programs: static ELF64 files from the disk run in ring 3, each in an
address space of its own (physmap, shared kernel half), with int 0x80
system calls; a guide to writing them; a new banner.
Added
- Physmap: all physical memory (up to 64 GB) at
0xFFFF800000000000, with
its tables in the kernel image; page tables are edited through it - User programs (
kernel/proc/,user/): static ELF64 files from the disk
(/disk0/BIN), loaded into an address space of their own and run in ring 3
on a kernel thread (iretq,TSS.rsp0set by the scheduler on every
switch);int 0x80system callsexitandwritewith user pointer
checks; a fault in ring 3 ends the program with 128 + vector instead of a
panic; the shell'sruncommand;HELLO.ELF,FAULT.ELF,BADPTR.ELF AddressSpace::isUserAccessible;GDT::setKernelStack; TCBowneruser/README.md: a guide to writing user programs (environment, memory
layout, system calls, exit codes, a first program, debugging a crash, build
rules);COUNT.ELF, its example; user programs are built with-gscripts/symbolize.shresolvesRIP=of a register dump too, against any
ELF file: the kernel or a user program- Self tests for ELF parsing and the user programs (706 checks); the shell
test runs programs - Several address spaces:
AddressSpace(pmm, kernel)shares the kernel's
PML4[0]andPML4[256..511];allocateAt/freeAtmap zeroed 2 MB user
pages inPML4[1..255];activate(),isActive(); the destructor gives
back pages and tables (owned pages are marked in entry bit 9)
Changed
- A new banner in plain ASCII, in color; the shell clears the screen and
shows it with the version, free memory and mounted disks; the boot starts
with a one line version message VGATextConsoleunderstands ANSI colors and UTF-8 block characters, so
the screen and a serial terminal show the same outputtasksandvmmaplines fit 80 columnsscripts/take-screenshots.py: the VGA screen after boot and in the shell- The PMM and VMM no longer log every allocation
- The recursive page table mapping (
PML4[510]) is gone - The PMM manages at most the 64 GB the physmap covers
Fixed
InterruptFramehadrsiandrdiswapped: register dumps showed them
the wrong way round, and system call arguments would have been read from
the wrong registers
Boot it with qemu-system-x86_64 -cdrom atlOS-0.3.0.iso -m 512M -serial stdio.
Build from source: see docs/building.md.
atlOS 0.2.0
Fault handling, synchronization, the keyboard, disks with FAT16 and a VFS,
and a kernel shell.
Added
- CI on GitHub Actions: build, self tests, format and clang-tidy on every push
and pull request; tagged releases are built and published automatically scripts/build-toolchain.shbuilds the cross toolchain (pinned versions,
verified downloads)- TSS with an IST stack for the double fault handler: a broken kernel stack
is reported instead of resetting the machine (triple fault) - Exception reports decode the page fault (CR2, read/write/fetch, present,
user/kernel) and selector error codes (#TS, #NP, #SS, #GP) - Panic backtrace through the frame pointer chain;
scripts/symbolize.sh
turns its addresses into functions and lines crashtestpreset andscripts/run-crashtest.sh: a kernel that page faults
on purpose, its report is checked in CI- Self tests for fault decoding, the TSS and the backtrace (175 checks)
kernel/sync/:Atomic<T>,InterruptGuard,WaitQueue(FIFO),
countingSemaphore(take/tryTake/give,givefrom interrupt
handlers),Mutexwith an owner,ConditionVariable; teaching README- Self tests for the sync objects (265 checks)
Drivers::PS2Keyboard(IRQ 1) behind a newCharacterSourceinterface:
scancode set 1 decoding (Shift, Caps Lock, Ctrl, extended keys) as a pure
ScancodeDecoder, US layout, a 64 character buffer,read()waits on a
semaphore; self tests (333 checks)- The VGA console handles backspace
- Storage:
BlockDeviceinterface;ATAPioDevice(IDENTIFY, 28-bit LBA PIO
with polling and timeouts),MemoryBlockDevice, MBR partition table and
PartitionDevice; read onlyFs::Fat16(8.3 names, subdirectories,
checks for broken cluster chains);Fs::Vfswith mount points (/disk0);
the ATA disks are probed and their FAT16 partitions mounted at boot scripts/make-disk-image.shand thedisk-imagetarget build the test disk
without root (sfdisk, mkfs.fat, mtools); the self tests read it in CI
(439 checks)- FAT16 writing:
create,write(append and overwrite, clusters allocated
first fit, every FAT copy updated),makeDirectory,remove,
removeDirectory, also throughFs::Vfs; fixed 1980-01-01 timestamps scripts/check-test-disk.sh: after the self tests,fsck.fatand mtools
check on the host what the kernel wrote to the test disk (577 checks)- Kernel shell (
kernel/shell/), started by the normal kernel: line editor
(Backspace, Ctrl+C, history on Up/Down), quoted words, a command table:
help,clear,echo(with>/>>),version,uptime,pwd,cd,
ls,cat,touch,mkdir,rm,rmdir,mount,mem,md,mw,
vmmap,tasks/ps,cpuinfo,panic,fault,reboot Drivers::CharacterQueue: the keyboard and COM1 (receive interrupt, new)
feed one queue; the arrow keys arrive as ANSI sequencesDrivers::TeeSink: the console writes to the screen and COM1AddressSpace::translate(no fault, physical 0 told apart from unmapped,
4 KB tables followed) andforEachMapping;Memory::heapStatistics- TCBs carry a name and their stack range
scripts/run-shelltest.py/scripts/build.sh shelltest: the shell driven
over the serial port in CI; self tests for the parser, line editor and
commands (651 checks)
Changed
- clang-tidy findings are errors (
WarningsAsErrors) - One panic path: exceptions and
kernelPanicprint a backtrace and halt with
cli; hlt; the exit status goes to an optional debug exit port
(ATLOS_DEBUG_EXIT_PORT, set by the test presets) instead of a hard coded
test device, so test kernels also run on real hardware - New threads and the boot flow start with
rbp = 0 - The scheduler tick counter is a
Sync::Atomic; idling insti; hlt
restores the caller's interrupt state SpinlockusesSync::Atomic- The default kernel echoes keyboard input instead of running the A/B demo
threads, and lists the mounted disks first - The serial port sends
\r\nfor\n; the console no longer leaves the
screen when COM1 exists - The default kernel starts the shell instead of the keyboard echo demo
PS2Keyboardpushes into aCharacterQueueinstead of its own buffer- Removed the old
DeviceManager,Device/Diskclasses, the untested FAT16
write code and thesudobased disk scripts
Fixed
-
A task that kept the CPU after a sleep (nothing else to run) stayed in the
Ready state instead of Running -
Exception names for vectors 10..21 were off by one (a page fault was
reported as "IntelReserved")
Boot it with qemu-system-x86_64 -cdrom atlOS-0.2.0.iso -m 512M -serial stdio.
Build from source: see docs/building.md.
atlOS 0.1.0
First release.
Kernel
- x86_64 higher half kernel booted by GRUB2 (multiboot2): loaded at 4 MB,
mapped at0xFFFFFFFF80000000with 2 MB pages - GDT, IDT, exception reports with a register dump
Drivers::PIC(8259) andDrivers::PITbehind theInterruptControllerand
TickSourceinterfaces; only the lines a driver uses are unmaskedMemory::PhysicalMemoryManager: 2 MB blocks from the multiboot memory map,
4 KB frames for page tables, kernel image reservedMemory::AddressSpace: 2 MB pages through a recursive page table mapping- kernel heap (
kmalloc,kfree,krealloc,kcalloc) on liballoc 1.1 Threading::Scheduler: cooperative round robin withyield,sleep,
block/unblockand thread exit; each thread has its own 2 MB stack page- console on COM1 and the VGA text screen (
Core::setConsole) - CPUID helpers, BIOS/SMBIOS parsing, a small freestanding libc
- in the tree but not wired up yet: ATA, FAT16, VFS, keyboard, mutex, semaphore
Build, tests and tooling
- one CMake project with presets (
build/<preset>),scripts/build.shfor
all,iso,run,debug,selftest,docs,format,tidy - 139 in-kernel self tests run headless in QEMU (
scripts/build.sh selftest,
CTest); most build isolated instances on fakes - WebKit code style with clang-format and clang-tidy; the build fails if SIMD
instructions end up in the image - the version comes from
project(atlOS VERSION ...); the banner shows it with
git describe
Fixed during development
- the ISR stubs added the interrupted code's
r12torspand overwroterax - the PMM handed out the kernel's own physical memory
- page directories were linked at the wrong physical address
- the first
yieldoverwrote thread 0's context - thread stacks broke the System V stack alignment
- libc was built with SSE although SSE is never enabled
- serial writes did not wait for the transmitter between bytes
Boot it with qemu-system-x86_64 -cdrom atlOS-0.1.0.iso -m 512M -serial stdio. Build from source: see docs/building.md.