All Projects → tyler569 → nightingale

tyler569 / nightingale

Licence: GPL-3.0 License
A small operating system where I experiment and learn osdev.

Programming Languages

c
50402 projects - #5 most used programming language
ruby
36898 projects - #4 most used programming language
assembly
5116 projects
CMake
9771 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to nightingale

duckOS
Yet another hobby x86 UNIX-like operating system written in C and C++. Features a dynamically linked userspace, an in-house c standard library, and more! And yes, it runs DOOM.
Stars: ✭ 250 (+190.7%)
Mutual labels:  kernel, os, osdev, operating-system
poplar
Microkernel and userspace written in Rust exploring modern ideas
Stars: ✭ 217 (+152.33%)
Mutual labels:  kernel, os, osdev, operating-system
Emerald
An operating system written in C
Stars: ✭ 118 (+37.21%)
Mutual labels:  kernel, os, osdev, operating-system
DentOS
Experimental Stand-alone 32-bit Kernel with Bootloader written in AT&T Assembly and Freestanding C
Stars: ✭ 32 (-62.79%)
Mutual labels:  kernel, os, osdev, operating-system
biefircate
Running x86-16 or x86-32 code from x86-64 UEFI; _very experimental_ • mirror of https://gitlab.com/tkchia/biefircate • developer notes at https://gitlab.com/tkchia/biefircate/-/blob/main/doc/NOTES.asciidoc
Stars: ✭ 47 (-45.35%)
Mutual labels:  kernel, os, osdev, operating-system
Reactos
A free Windows-compatible Operating System
Stars: ✭ 10,216 (+11779.07%)
Mutual labels:  kernel, os, osdev, operating-system
Unikraft
Unikraft is an automated system for building specialized POSIX-compliant OSes known as unikernels. (Core repository)
Stars: ✭ 183 (+112.79%)
Mutual labels:  kernel, os, osdev, operating-system
Wingos
a little 64bit operating system written in c++ with smp support
Stars: ✭ 361 (+319.77%)
Mutual labels:  kernel, os, osdev, operating-system
KnutOS
An x86_64 hobbyist OS written in C and Assembly
Stars: ✭ 16 (-81.4%)
Mutual labels:  kernel, os, osdev, operating-system
chaos-2
A hand-made SMP-aware kernel
Stars: ✭ 20 (-76.74%)
Mutual labels:  kernel, os, osdev, operating-system
Toaru Nih
NOTICE: The ToaruOS-NIH Project has been MERGED UPSTREAM. This repository is now archived.
Stars: ✭ 66 (-23.26%)
Mutual labels:  kernel, os, osdev, operating-system
SnowFlake
Technology is free, SnowFlakeOS
Stars: ✭ 38 (-55.81%)
Mutual labels:  kernel, os, osdev, operating-system
Dennix
Dennix is a unix-like hobbyist operating system written from scratch.
Stars: ✭ 53 (-38.37%)
Mutual labels:  kernel, os, osdev, operating-system
Tofita
🍬 All-new kernel for @GreenteaOS
Stars: ✭ 112 (+30.23%)
Mutual labels:  kernel, os, osdev, operating-system
Aquila
AquilaOS: UNIX-like Operating System
Stars: ✭ 413 (+380.23%)
Mutual labels:  kernel, os, osdev, operating-system
Cyjon
A simple, clean code, multi-tasking operating system written in pure assembly language for 64-bit processors from the AMD64 family.
Stars: ✭ 184 (+113.95%)
Mutual labels:  kernel, os, osdev, operating-system
LudOS
A toy monolithic kernel written in C++
Stars: ✭ 38 (-55.81%)
Mutual labels:  kernel, os, osdev, operating-system
Toaruos
A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
Stars: ✭ 4,687 (+5350%)
Mutual labels:  kernel, os, osdev, operating-system
Cardinal
Operating system designed to be fast and secure.
Stars: ✭ 20 (-76.74%)
Mutual labels:  kernel, os, osdev, operating-system
Macaron
A sweet hobby made operating system written in C++ for x86 CPUs with GUI
Stars: ✭ 34 (-60.47%)
Mutual labels:  kernel, os, osdev, operating-system

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].