Ghost Kernel

Threaded system calls & kernel-privilege thread support added 2019/03/04, 16:38:10

The redux branch has now support for kernel-level threads and threaded system calls. The previous implementation only supported userspace-threads which had some advantages but also made specific call implementations more complicated. This approach will improve efficiency and allows a better scheduling implementation in the long run.

There were some interesting problems to solve; due to the fact that a kernel thread might get interrupt while holding a kernel lock, the g_mutex implementation must now keep track of the number of locks held per processor. As long as a task holds kernel locks, no other task will be scheduled until the task is finished with its work.

System calls can now be registered as threaded or direct calls. When a threaded call is executed, the respective handler is called within a kernel-level thread. These processing tasks are reused for successive system calls by the same task. This allows preemption during call processing and avoids blocking the scheduler for long-running requests.


Write a comment...
  • timle1 2021/12/04, 10:10:56

    Scandal porn galleries, daily updated lists

    free asian midget porn tube free mobile puke porn ugly black girl porn mature porn picts 1940s porn clips

  • janieqo2 2021/12/03, 23:46:34

    Nude Sex Pics, Sexy Naked Women, Hot Girls Porn

    afterhours porn rape porn mp4 videos hottest porn scene bikini porn free porn videos kayden 420

  • jerrivp16 2021/12/02, 20:21:09

    Hot teen pics

    barly teens uk porn free hairy pussy porn online femdom tube porn fat sex moms granny porn tubes homemade porn swingers

  • altheabb16 2021/12/01, 17:08:32

    New sexy website is available on the web

    top class fake celebrity porn pictures of teen porn incredibles free porn gallery vintage porn pics young biggest porn download

  • terrysh4 2021/11/29, 10:29:24

    Hot teen pics

    miget masterbation porn tube solo grls porn inspector mathew rush porn nick east porn extremely old granny porn

  • geraldinems69 2021/11/29, 05:48:32

    Young Heaven - Naked Teens & Young Porn Pictures

    free porn darl lily dancing porn tube wwe melina in porn sex with old ladies porn phillipean young porn

  • donjl4 2021/11/28, 21:16:07

    Sexy teen photo galleries

    how to be a porn producer free teen young porn tubes unknown porn archives dirty older women porn movies buff chic porn

  • reginayt4 2021/11/27, 18:12:11

    Young Heaven - Naked Teens & Young Porn Pictures

    mexico and black man porn hottest new porn stars holiday porn videos exreme anal prolapse porn bush wins porn jpeg

  • pedroop1 2021/11/27, 00:19:43

    Sexy photo galleries, daily updated collections

    porn with parents girl solo porn shared porn movies free hentai or anime porn site puke porn moies

  • dennisvr11 2021/11/24, 22:14:01

    Daily updated super sexy photo galleries

    free porn pics secret maliah michel in porn free big tit porn movies japan amateur porn free sites list porn

  • carmelaxo4 2021/11/24, 01:15:53

    New project started to be available today, check it out

    mature women porn video clips oedipus porn tube flexible girls porn bib tits porn milf teen porn galleies

  • Hamidreza 2019/05/30, 17:55:09

    hello friend!

    I'm happy to your coming back.

    Please continue to developing.


  • Martin Vahi 2019/03/07, 20:33:18

    You may want to study the ideas behind the ParaSail programming language, when developing some threading model. One of the peculiarity of the ParaSail programming language is that it is a systems programming language that is meant to be used with safety critical systems, has formal verification tools designed right into the language from the very start and is designed to work with 1000+ core CPUs by using a new threading model that minimizes the threading related burden of software developers. As of the writing of this comment, the newest version is the ParaSail_8.0!topic/parasail-programming-language/tt8MMqtV8k8

    but repackaged older versions can be found from my home page at

    The older versions might be easier to build, specially the version 6.5, which does not have a fast implementation, but is good enough for studying the ideas behind the ParaSail.

    I am NOT a ParaSail author. The ParaSail is created/invented by the Ada language designer, the Tucker Taft, who designed it as a summary of all of his life long language design knowledge. The purpose was to create a brand new systems programming language that is not just "a better C", but that takes to account the formal verification achievements from the very start, since the design phase of the language and that is designed with perfection in mind, without needing to support any old legacy code. The nice thing about the ParaSail is that it is not yet-another-academic-one-off-project that is dumped the moment grant money runs out or papers get published or thesis gets defended. The ParaSail is actually designed by an industrial developer, the Tucker Taft, and it is meant to be PRACTICAL in industrial scenarios. As of 2019_03 the downside of the ParaSail is the legal uncertainty: it's GPLv3 and the Tucker Taft claims that the stdlib is in public domain and according to his 2019_03 understanding the development of commercial, closed source, software is not limited by the current ParaSail license, but I believe that as there is no clear statement about that in the ParaSail sources, the situation can be interpreted both ways, so from my point of view the ParaSail stdlib is under GPLv3. But it is still a remarkable project for learning, self education.

    Thank You for reading my comment.

  • Guillaume 2019/03/06, 02:57:37

    Hi !

    I have a question about the kernel-level thread created for syscalls : do you mean that this thread, once created, will live until user thread (or user process ?) die ?

    I always thought that having kernel-level threads was necessary to create a kernel, I can see that it's not an obligation but it seems necessary in your case ?

    • Max 2019/03/06, 03:32:09

      Hi Guillaume!

      The kernel-level thread that is created is only scheduled until the syscall is finished; it then gets the state "unused" but the allocated structures (stack etc.) stay alive. Once the user thread finishes, this processing thread is also deleted. I'm thinking about sharing those unused threads between multiple user threads though to improve this more.

      Well, in the existing (master branch) implementation of Ghost, there are only Ring 3 threads, no Ring 0 at all. This had the advantage that faulty code would less frequently kill the entire system. But in this first approach I did, there are also many limitations. System calls could not be interrupted. When you needed some thread to do stuff that would normally require kernel-permissions, there had to be a system call for every bit of work. All of that increased latency a lot.


    • Guillaume 2019/03/06, 06:46:51

      Yes I think you could use this same kernel-level thread for all threads of the same process ? (all these threads sharing the same virtual memory space...).

      I don't understand why your System calls couldn't be interrupted ? If an interrupt occurred, the kernel just has to switch to a new kernel stack (associated to the user thread) for this interrupt. In this way, the kernel stack used for the syscall is not corrupted by the interrupt. But maybe I didn't understand the problem your are talking about...

      Anyway thank you for your answer !

    • Max 2019/03/06, 06:52:51

      What I mean with that is, it is pretty hard to properly make the interrupt handlers preemptible. During interrupt handling, another interrupt could be fired, which would push again onto the current kernel stack. Using kernel level threads for the syscall handling I can avoid interrupting the system call handler.

    • Guillaume 2019/03/06, 06:59:41

      Ok I understand, I didn't come far enough in my project to have this problem I guess...

      Thank you for your answers and have a nice day ;)

    • Max 2019/03/06, 09:24:10

      Sure! Good luck with your project :-)