a unix inspired, non posix compliant micro kernel (more of a monolithic kernel for now though) that i am working on in my spare time

Overview

toy-kernel

a unix inspired, non posix compliant micro kernel (more of a monolithic kernel for now though) that i am working on in my spare time

prerequisites

to build the kernel you will need:

  • clang (version 12 or newer),
  • lld (i don't think the version matters here),
  • nasm (i don't think it matters here either)

to build the disk image you will need parted, and to run the kernel you will need qemu

building

make sure you checked out the limine submodule as it is required to build the disk image

to build the kernel itself you can run make kernel in the root directory

to build the disk image you can run one of these following commands:

  • make image-bios which will build a legacy disk image with limine installed in its boot sector,
  • make image-uefi which will build an uefi compatible disk image

to run the kernel you can run one of these following commands:

  • make run which will run the legacy disk image in default configuration without kvm,
  • make run-kvm which will run the kernel in default configuration with kvm,
  • make run-debug which will run the kernel with interrupt logging and without kvm,
  • make run-gdb which will run the kernel in default configuration without kvm and with a gdb server set up on port 1234

if you want to use any of these command with a uefi compatible image, add FIRMWARE=uefi to the command, i strongly recommend to use the legacy bios images for testing due to the uefi firmware being terribly slow for some reaosn and only use the uefi images if you want to make sure everything is working for both legacy and uefi modes

license

this project is licensed under the terms of the gnu general public license v3.0, the text of the license can be found in the LICENSE.txt file in the root of this repository

Comments
  • (Reopened)How is " valid syntax????">

    (Reopened)How is "#include " valid syntax????

    Im just as confused as VS Codium, how is #include <system/syscalls.h> valid syntax while #include <system/elf.h> is not? Ive looked through all of the Cmake lists and I dont see anything that would make this make sense.

    Please help!

    opened by YusufKhan-gamedev 5
  • Porting to ARM, RISCV, MIPS, PowerPC

    Porting to ARM, RISCV, MIPS, PowerPC

    How would I begin porting the Toy kernel to other architectures? Im creating a distribution of the Toy kernel for embedded systems and its a little hard for users to only use x86 embedded systems for it.

    opened by YusufKhan-gamedev 3
  • What is uint64_t in the context of Threads and Processes?

    What is uint64_t in the context of Threads and Processes?

    Im porting the Plan9 core utils to the toy kernel and many utils really need the exec syscall to function.o When looking at process.cpp and process.h I see Process::spawn and Thread::spawn have a 64 bit int call entry as one of its inputs. Could that section be skipped(when calling a application), and what does it do?

    Is it just the variable thats passed?

    opened by YusufKhan-gamedev 3
  • Syscalls: Use Switch Case instead of if else

    Syscalls: Use Switch Case instead of if else

    This makes it look a little neater and may run better when more syscalls are added. Also if you havent already could you address this issue?[https://github.com/czapek1337/toy-kernel/issues/1]

    opened by YusufKhan-gamedev 3
  • Minor issue: replace c++ with clang++ for arch users

    Minor issue: replace c++ with clang++ for arch users

    I tried to compile the Toy kernel on my laptop that runs arch and I keep getting the error

    c++: error: unrecognized command-line option ‘-target’
    make[2]: *** [libs/core/CMakeFiles/core.dir/build.make:76: libs/core/CMakeFiles/core.dir/src/core/lock.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:452: libs/core/CMakeFiles/core.dir/all] Error 2
    make: *** [Makefile:91: all] Error 2
     
    

    When patching c++ with clang another error pops up, im too lazy to fix this issue if you want to you can fix this, its a bit of a minor issue due to a work around.

    opened by YusufKhan-gamedev 2
  • Build error invalid block size expression '1M'

    Build error invalid block size expression '1M'

    I got a new error when trying to compile my set of core utils:

    dd: invalid block size expression '1M'
    Error: Could not stat device /home/yusufkhan/toy/toy-kernel/build/disk-uefi.img - No such file or directory.
    Error: Could not stat device /home/yusufkhan/toy/toy-kernel/build/disk-uefi.img - No such file or directory.
    [sudo] password for yusufkhan: 
    Sorry, try again.
    [sudo] password for yusufkhan: 
    losetup: /home/yusufkhan/toy/toy-kernel/build/disk-uefi.img: failed to set up loop device: No such file or directory
    umount: /home/yusufkhan/toy/toy-kernel/build/disk_root: not mounted.
    losetup: option requires an argument -- 'd'
    Try 'losetup --help' for more information.
    [100%] Built target image-uefi
    
    

    Compiling went fine but the disk-uefi.img was not generated.

    CC=clang-13 CXX=clang++-13 cmake ..
    make image-uefi
    

    was used in /toy-kernel/build to compile it.

    opened by YusufKhan-gamedev 2
  • How to configure new drivers

    How to configure new drivers

    Ive created a basic keyboard driver in /src/dev and was wondering how I would configure it with the rest of the kernel to allow for it(with debugging and so on).

    opened by YusufKhan-gamedev 2
  • fatal error: core/vector.h: No such file or directory

    fatal error: core/vector.h: No such file or directory

    I have all the dependencies that you have specified(including limine) and when I run make kernel I get the error

    [  3%] Building CXX object CMakeFiles/kernel.dir/src/acpi/acpi.cpp.o
    /home/yusufkhan/toy/toy-kernel/kernel/src/acpi/acpi.cpp:1:10: fatal error: core/vector.h: No such file or directory
        1 | #include <core/vector.h>
          |          ^~~~~~~~~~~~~~~
    compilation terminated.
    make[3]: *** [CMakeFiles/kernel.dir/build.make:76: CMakeFiles/kernel.dir/src/acpi/acpi.cpp.o] Error 1
    make[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/kernel.dir/all] Error 2
    make[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/kernel.dir/rule] Error 2
    make: *** [Makefile:124: kernel] Error 2
    
    

    How do I fix this?

    opened by YusufKhan-gamedev 2
  • kernel(0): fatal: intr.cpp:88: release( ) called when interrupts were not retained

    kernel(0): fatal: intr.cpp:88: release( ) called when interrupts were not retained

    When running com::scan(1, 1); in maincpp(the com::scan thing comes from my borked branch where I put non-working things) and when running that I get kernel(0): fatal: intr.cpp:88: release( ) called when interrupts were not retained What does that mean and how would I fix that?

    opened by YusufKhan-gamedev 0
  • [request] Could this project remain small(in size)

    [request] Could this project remain small(in size)

    The main reason I am looking into the toy kernel is due to the fact that code size and the fact that it does not contain that that much bloat from POSIX and the "Everything is a File" approach to I/O.

    I believe that the kernel shouldnt include very niche things in its design. This is ultimately a request, whatever you decide is what you decide, and not fully in my control, if there does become more bloat i will probably produce a stripped down fork that I would use personally.

    opened by YusufKhan-gamedev 0
  • Propose MIT Liscence

    Propose MIT Liscence

    This is a proposition for the kernel portion of the toy-kernel. I would also be fine/happy with the GPL with the following exception(Linux syscall exception):

    NOTE! This copyright does not cover user programs that use kernel services by normal system calls - this is merely considered normal use of the kernel, and does not fall under the heading of "derived work". Also note that the GPL below is copyrighted by the Free Software Foundation, but the instance of code that it refers to (the toy kernel) is copyrighted by me and others who actually wrote it.

    opened by YusufKhan-gamedev 0
Owner
czapek
czapek
An Operating System made in my spare time.

DarshOS Features Shell/Command Line Keyboard Input Might add in the future File System and Commands for File System IDT Networking GUI Setup / depende

null 8 Jun 29, 2022
sbase is a collection of unix tools that are inherently portable across UNIX and UNIX-like systems.

sbase is a collection of unix tools that are inherently portable across UNIX and UNIX-like systems.

Anton Samokhvalov 1 Nov 1, 2021
Fix some extrinsic parameter importing problems. 6-axis IMU works now. Lidar without ring works now.

LVI-SAM-MODIFIED This repository is a modified version of LVI-SAM. Modification Add function to get extrinsic parameters.The original code assumes the

null 88 Dec 9, 2022
A simple PoC to demonstrate that is possible to write Non writable memory and execute Non executable memory on Windows

WindowsPermsPoC A simple PoC to demonstrate that is possible to write Non writable memory and execute Non executable memory on Windows You can build i

Lorenzo Maffia 55 Jul 21, 2022
Proof of concept userspace filesystem that executes filenames as shell commands and makes the result accessible though reading the file.

ExecFS Proof of concept userspace filesystem that executes filenames as shell commands and makes the result accessible though reading the file. $ ./ex

Camel Coder 42 Jan 7, 2023
An easy to build CO2 Monitor/Meter with Android and iOS App for real time visualization and charting of air data, data logger, a variety of communication options (BLE, WIFI, MQTT, ESP-Now) and many supported sensors.

CO2-Gadget An easy to build CO2 Monitor/Meter with cell phone App for real time visualization and charting of air data, datalogger, a variety of commu

Mariete 30 Dec 17, 2022
Professor Terence Parr has taught us how to create a virtual machine Now it is time to pwn virtual machine

My First real world CTF Simple Virtual Machine Challenge description Professor Terence Parr has taught us how to create a virtual machine Now it is ti

null 1 Feb 17, 2022
Working example for local_flutter_notification package in Flutter. Includes setting notification at custom time, daily, weekly.

local_notification_example Working example for local_flutter_notification package in Flutter. Includes setting notification at custom time, daily, wee

Nivedita Datta 4 Oct 3, 2021
A run-time C++ library for working with units of measurement and conversions between them and with string representations of units and measurements

Units What's new Some of the CMake target names have changed in the latest release, please update builds appropriately Documentation A library that pr

Lawrence Livermore National Laboratory 112 Dec 14, 2022
Simulate Linux Completely Fair Scheduler (CFS) using POSIX Threads

Linux CFS Simulator Simulate Linux Completely Fair Scheduler (CFS) using POSIX Threads. Build and Run $ make $ ./cfs-sim Note: The process status tabl

null 19 May 4, 2022
This program try to recreate bash --posix comportement in certain limite

minishell : petitcoquillage This program try to recreate bash --posix comportement in certain limite Execution : To execute this Program you have to b

null 63 Dec 9, 2022
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.

中文版本请参看这里 MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Andr

Tencent 15.4k Jan 8, 2023
Implementation of POSIX mqueue using System V messages

mqueue-mac Implementation of POSIX mqueue using System V messages. 23-January-2022 James P. Parziale Description I got frustrated not being able to te

Jim-P 0 Jul 3, 2022
Phan Sang 17 Dec 29, 2022
3D scanning is becoming more and more ubiquitous.

Welcome to the MeshLib! 3D scanning is becoming more and more ubiquitous. Robotic automation, self-driving cars and multitude of other industrial, med

null 121 Dec 31, 2022
Realtime Micro Kernel -- Event-driven Run-to-Completion RTOS with Active Objects, Timed Events, Memory Pools, and Message Queues

Realtime Micro Kernel Features Active Objects Message queues Variable sized, custom messages Periodic and single timed events Memory pools Supported P

null 3 Nov 7, 2022
Minos2 is a micro-kernel OS for ARMv8-a

Minos2 Minos2 is a micro-kernel OS for ARMv8-a. Multi-process SMP Multi-thread Virtual memory management Libc (based on musl-libc) IPC VFS Ext4 (based

Minos Developer Community 110 Dec 3, 2022
The Kernel-Mode Winsock library, supporting TCP, UDP and Unix sockets (DGRAM and STREAM).

libwsk 简体中文 About libwsk is a wrapper for the WSK (Winsock-Kernel) interface. With libwsk, kernel-mode software modules can perform network I/O operat

MeeSong 149 Dec 28, 2022