• Stars
    star
    127
  • Rank 281,141 (Top 6 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A small operating system where I experiment and learn osdev.

Nightingale

About

Nightingale is an operating system for x86_64 that I have been developing for 5 years to learn about low-level programming and operating system design.

Nightingale implements a mostly POSIX-like userland, though compliance is not a goal. I see POSIX as useful as a well-understood and documented interface, and one that permits compatability with large amounts of existing software.

Screenshot

For more specific feature and capability information, see ABOUT.md.

Project map

Directories

  • doc: Documentation
  • include: Header files for the whole system
  • interface: Interface definitions for syscalls and errno values
  • kernel: The core of the operating system
  • libc: Common userland routines, including things like printf
  • linker: Kernel module loader, userland dynamic linker, and libelf
  • modules: Kernel modules, mostly testing for now
  • script: Utility scripts for building and developing nightingale
  • toolchain: Patches and staging area for hosted gcc toolchain
  • user: In-tree usermode programs distributed with the system

Scripts

  • build_toolchain.bash: builds the custom gcc for the x86_64-nightingale target
  • dump.rb: convenience wrapper around objdump
  • flamegraph.bash: convenience wrapper to call flamegraph - see ABOUT.md
  • format.bash: convenience wrapper around the clang-format code formatter
  • generate_syscalls.rb: render the syscall and errno manifests into C datastructures
  • install_headers.bash: create sysroot and install system headers to the sysroot
  • run.rb: convenience wrapper around qemu-system-x86_64 to set the options I need

Interface Manifests

These manifest files define the public syscall interface of the nightingale kernel, they are rendered into C enums and metadata that is used by both the kernel and the C library.

  • ERRNOS: defines the values of errno, their names, and their perror strings
  • SYSCALLS: defines syscall numbers, types, and arguments

Building nightingale

Nightingale uses the CMake build system and defaults to the clang compiler.

The only uncommon package you will need is the grub-mkrescue tool provided by grub2. This is usually packaged with grub2 or in a 'grub tools' package.

  • Clang (default)
    • Execute make in the root of the project.
    • To run, use ./run.rb - its help text will show the available options Clang (default)
  • GCC (extra programs only)
    • Inspect script/build_toolchain.bash to see the dependencies and edit the constants to match your environment (install directory, parallelism, etc)
    • Run script/build_toolchain.bash and ensure the resulting binaries are available on your PATH
      • x86_64-nightingale-gcc --version should show the GCC version if everything worked correctly.
      • As written, the script assumes you have ~/.local/bin on your PATH - you'll want to edit PREFIX and/or PATH to put it somewhere else.

I was able to build and run nightingale on a stock Ubuntu 20.04 image with the following commands:

$ apt update
$ apt install git make cmake clang llvm lld ninja-build ruby xorriso mtools qemu-system
$ git clone https://github.com/tyler569/nightingale.git
$ make
$ ./run.rb

Why 'nightingale'?

I have a long history of naming projects after birds, this is no exception.

Acknowledgements

I used many resources to learn what I needed to get to where I am, but a special shout-out goes to the OSDev Wiki community, for their extensive and comprehensive reference material that I have made extensive use of.

I've used code from several other people, lots of credit goes to lua, the Sortix project for their libm, Nicholas J. Kain for the original implementation of my setjmp, and Krzysztof Gabis for writing the brainf**k interpreter that was the first third-party software I ever ported to nightingale.

More Repositories

1

linker

The module loader and dynamic linker of the nightingale operating system
C
8
star
2

tunnel

A simple VPN that crates a UDP tunnel and encrypts packets
Go
6
star
3

ipstack

An IP stack built on raw Ethernet frames that provides a socket API to threads
C
4
star
4

cnit315-irc

An IRC bot my C programming class
C
3
star
5

uthread

Cooperative usermode threads
C
3
star
6

algol68

Explorations in ALGOL
2
star
7

tcp

Rust networking
Rust
2
star
8

go-nightingale

A WIP fork of the Go programming language that supports the nightingale operating system
Go
2
star
9

osprey-server

Osprey is a Minecraft server written in Java that contains no code from Mojang
Java
2
star
10

zig-irc

A minimal IRC client in zig
2
star
11

compiler

A work-in-progress C compiler written in C
C
2
star
12

template-queens

An implementation of the N Queens algorithm written entirely in the C++ type system.
C++
2
star
13

hlre

Rust
2
star
14

irclib

IRC library for python 3
Python
2
star
15

rsinit

A Linux init system in Rust
Rust
2
star
16

sortix-libm

A rehost of the Sortix operating system's libm
C
2
star
17

lcc

A (very WIP) C Compiler
C
1
star
18

oriole

It's an orange bird, get it?
Assembly
1
star
19

goinit

An /sbin/init for Linux, written in Go
Go
1
star
20

i8086-rs

An 8086 emulator in Rust
Rust
1
star
21

nodejs-linkshorten

A link generator made in node.js using MySQL as a backend
JavaScript
1
star
22

gol-sdl

The Game of Life in C
C
1
star
23

TicTacToe

AI to beat you in tic-tac-toe
Java
1
star
24

nimk

A nim kernel for x86_64
Assembly
1
star
25

go-vm

Golang Virtual Machine
Go
1
star
26

pastecrypt

Client-side encrypted paste service
Ruby
1
star
27

http-dns-server

A dynamic DNS server controlled by HTTP POSTs
Rust
1
star
28

LearnWin32

Somehow this turned into an assembler / JIT
C
1
star
29

random-snippets

Just some stuff I came up with
C++
1
star
30

inetd

An implemnetation of an inetd-like stdio-based suite of internet protocol daemons.
C
1
star
31

intcode-cpu

An HDL implementation of the intcode CPU from Advent of Code 2019
Verilog
1
star
32

simple_asm

Assembler toolkit for simple CPUs, including simple16 and PISA
Ruby
1
star
33

mkelf

Take some things, make an ELF
Go
1
star
34

lambda-ssh-ca

An SSH CA that runs as an AWS lambda function.
Python
1
star
35

aquatic

A simple packet processing engine
C++
1
star
36

rjit

Skeleton of an assembler/JIT in Rust
Rust
1
star
37

cardinal-legacy

A super-WIP operating system written in Rust
Rust
1
star
38

combat-tracker

EX3 combat initiative tracker web app (WIP)
Ruby
1
star
39

pyshorten

A minimalist python link shortener using cgi and sqlite3 from the standard library.
Python
1
star
40

matrix-server-terraform

Terraform I used to set up my self-hosted Matrix server
HCL
1
star
41

untitled-bare-metal

It's an OS, but mostly it's a playground for ideas.
C
1
star