OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 04, 2021 7:37 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Tilck (Tiny Linux-Compatible Kernel) v0.1
PostPosted: Mon Jan 18, 2021 7:03 pm 
Offline
Member
Member

Joined: Fri May 11, 2018 6:51 am
Posts: 75
Hello everyone,
after a long time, I'm pleased to announce the first release of Tilck (version 0.1).

What is Tilck?
Tilck is a x86 monolithic kernel designed to be partially compatible with linux-i686 at binary level,
but it does not aim to re-implement Linux nor to become a desktop operating system. It is, for the
moment, an educational project that I see as the perfect playground for playing in kernel mode while
retaining the ability to compare how the very same usermode bits run on the Linux kernel as well.

Why trying to be compatible with Linux?
To me, this feature is extremely valuable as it allows the kernel to run third-party software like BusyBox,
VIM, fbDOOM, Lua, TinyCC etc. never written for Tilck: this way, I'm able to test the correctness and the
robustness of my implementation against well-known software and, in case there's a difference, I can
trace the same application/test on both Tilck and Linux and observe where differences start to appear.
To put it in a different way, I believe that writing user code for my own kernel it's like playing a video game
I wrote myself: I'm biased because I know too well how it works under-the-hood and it's less likely I'll
exploit issues. In addition, I value this feature also because it allows a whole class of Linux applications
to work as-it-is, without any porting. And, even when some effort is required to port something to Tilck (e.g.
the Linux feature XY needs to be implemented in the kernel), the payoff for that effort is high, as other
programs requiring the same feature will work, from now on. Still, that doesn't mean it make sense to
re-implement the whole Linux interface; it's a case-by-case thing.

Booting Tilck
Tilck comes with a custom interactive bootloader working both on legacy BIOS and on UEFI systems
as well. The bootloader allows the user to choose the desired video mode, the kernel file itself and to edit
kernel's cmdline. Also, Tilck can be loaded by multiboot-compatible bootloaders like GRUB.

Testing Tilck
Tilck has unit tests, kernel self-tests, system tests (using the syscall interface), and automated
interactive system tests
(simulating real user input through QEMU's monitor) all in the same repository,
completely integrated with its build system. In addition to that, there's full code coverage support and
useful scripts for generating HTML reports. Finally, Tilck is fully integrated with the Azure Pipelines CI, which
validates each pushed branch with builds and test runs in a variety of configurations. Kernel's coverage
data is also uploaded to CodeCov.

Hardware support
While the kernel uses a fair amount of legacy hardware like:
  • the 8259 PICs for IRQs
  • the 8254 PIT for the system timer
  • the 16550 UART for serial communication
  • the 8042 kb controller
  • the 8237 ISA DMA
  • the Sound Blaster 16 sound card (QEMU only)
It has also support for some recent hardware features like:
  • SSE
  • AVX
  • AVX 2
  • PAT
  • sysenter
  • enumeration of PCI and PCI Express devices (via ECAM)
  • ACPI support via ACPICA
ACPI is currently used to receive power-button events, to reboot or power-off the machine,
and to read the current parameters of machine's batteries (when implemented via ACPI control
methods).

File systems
Tilck has a simple but full-featured (both soft and hard links, file holes, memory mapping, etc.) ramfs implementation,
a minimalistic devfs implementation, read-only support for FAT16 and FAT32 (used for initrd) allowing memory-mapping
of files, and a sysfs implementation used to provide a full view of ACPI's namespace, the list of all PCI(e) devices and
Tilck's compile-time configuration. Clearly, in order to work with multiple file systems at once, Tilck has a simple VFS
implementation as well.


Future plans
In the long term, depending on how successful the project will be, Tilck might become suitable for
embedded systems. In particular, the plan to port this kernel to ARM existed from the very beginning
of the project. x86 was simply the most convenient architecture for me to start with. Also, it had the
advantage that most laptops and workstations are, indeed, x86 (x86_64) and that's great for testing
purposes and to show it to friends and colleagues. But, given the non-existent presence of x86 in the
SoC world, Tilck's real target architectures are ARM (e.g. Cortex-A) and maybe RISC-V. Because of that,
Tilck can already run today on a QEMU vm with just 4 MB of RAM, even if it's pointless on x86. Finally,
I'd like to make it work on MMU-less CPUs (e.g. ARM Cortex-R series), and enter in the realm of
microcontrollers and hard real-time operating systems. Clearly, the project is far from there, but we're
talking about the long term. Also, the kernel is already modular (has compile-time modules) and it has
been designed from to beginning to depend on a very few HW features. The biggest of them is the MMU.
But, given that Embedded Linux does support MMU-less systems, Tilck might evolve in that direction as well.
For example, it already has vfork(). Therefore, Tilck might become yet-another "linux-tinification" attempt,
with the plus of the BSD license, which is much more permissive than Linux's GPL v2.

Said that, the future remains uncertain and the project might not get enough engagement, as it happens to
most software projects. In that case, I'll continue to maintain it as an educational project with bug-fixes,
polishing and minor features here and there, depending on the amount of time I can spend on it. The
good news is that I've already received good feedback from students attending to operating systems
courses. Therefore, at least in the educational world, I believe this project has some serious hope.

Contributing to the project
While I obviously don't expect hordes of contributors, as anyone who created an open source project,
I hope that someone will take interest in mine, even if by making small contributions. From my
side, I took care to make the whole thing as painless as possible with scripts, tests, documentation etc.
and I'm prepared to spend time helping contributors as well.

Tilck on Github
https://github.com/vvaltchev/tilck

A short presentation video
https://www.youtube.com/watch?v=Ce1pMlZO_mI

Screenshots

Image

_________________
Tilck, a Tiny Linux-Compatible Kernel: https://github.com/vvaltchev/tilck


Top
 Profile  
 
 Post subject: Re: Tilck (Tiny Linux-Compatible Kernel) v0.1
PostPosted: Wed Jan 20, 2021 12:29 pm 
Offline
Member
Member

Joined: Tue Apr 03, 2018 2:44 am
Posts: 156
vvaltchev wrote:


Can I just way, awesome work. I was looking at this last week, and this is right up my street.


Top
 Profile  
 
 Post subject: Re: Tilck (Tiny Linux-Compatible Kernel) v0.1
PostPosted: Thu Jan 21, 2021 7:51 am 
Offline
Member
Member

Joined: Fri May 11, 2018 6:51 am
Posts: 75
thewrongchristian wrote:
Can I just way, awesome work. I was looking at this last week, and this is right up my street.

Thank you, man!

_________________
Tilck, a Tiny Linux-Compatible Kernel: https://github.com/vvaltchev/tilck


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group