Code Monkey home page Code Monkey logo

catk's Introduction

a simple Unix-like kernel made in C, with a cute kitty (CatK) to go with it


image image

Table of Contents

What is CatK?

CatK is a kernel taking inspiration from FreeBSD and similar Unix-like systems written almost completely in C.
CatK is also the cat that represents this project.

We love CatK.

Compiling it

You'll need:

  • a unix-like system/environment (preferably Linux)
    • compiling on Windows is possible provided a unix-style environment (uutils, mingw, etc). you cannot build any ISOs however (credit @Ruthenic)
  • clang 14+ with support for i686-pc-none-elf (so, most installs)
  • LLVM lld (or GNU ld, if you set it manually)
  • grub-mkrescue (This usually comes with GRUB) and xorriso
  • the NASM assembler
  • GNU make

Afterwards, it's very simple to compile. All you need to do is run make, and your ISO will be automagically prepared in the out/ folder.

You can skip ISO building and multiboot signature checking by using SKIP_ISO=1 make and SKIP_MB_CHECK=1 make respectively.

These are implied and forced on Windows, as they cannot be performed.

If you prefer, you can compile with multiple threads with make -j$(nproc). This will use as many threads as your CPU has available.

Running it

You can use essentially any virtualizer you have. We prefer QEMU or VirtualBox.

If you wanna use QEMU, you can start the ISO up with qemu-system-i386 -cdrom /path/to/catkernel.iso (hint: it's usually in out/)
Also, if you're using QEMU, you can directly start the kernel with qemu-system-i386 -kernel /path/to/catkernel.bin (hint: it's usually in out/isodir/boot, or just out/ if you are not building the ISO)

See "Debugging it" for compiling/running with a debugger (GDB/LLDB).

Debugging it

This guide assumes you already have a familiarity with GDB/LLDB (we can't assist with using your debugger of choice.)

First, build CatK with debug symbols enabled (make clean && DEBUG=1 make).

Next, run QEMU like this: qemu-system-i386 -s -S -kernel /path/to/catkernel.bin
QEMU will wait for you to attach a GDB-compatible debugger and to continue. Let's do that.

Run gdb /path/to/catkernel.bin or lldb /path/to/catkernel.bin. You will be dropped to your debugger's shell.

In that shell, run target remote localhost:1234 for GDB, and gdb-remote localhost:1234 for LLDB.

Run c to tell the VM to start running.

As a quick crash course, CTRL + C pauses execution while continuing, b function_name will let you break when the specified function is hit. s will let you step by instructions. c will continue as normal until the next breakpoint.

Happy travels.

Contributing

Contributions are accepted and encouraged!

Please try to follow the coding style (we have so much cleaning up to do...) that the rest of the code follows.

Please discuss changes you intend on making if they are large in the dev section of our Discord (see "Get in touch").

Support/Issues

If you have a question or a small issue/something you don't quite understand, it's best to just join our Discord. See "Get in touch" for that. Otherwise, if it's a large bug that you think you can provide good info on, it's best to create a GitHub issue as that helps us track the problem better.

Get in touch

Currently, the best way to get in touch with the developers, to discuss contributions, and generally be a part of the CatK community is to join our Discord.

It's quite nice there.

Licensing

CatK is licensed under the GNU General Public License version 3. See LICENSE.

catk's People

Contributors

rodmatronic avatar irixaligned avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.