|
|
Log in / Subscribe / Register

Writing kernel modules in Haskell

Writing kernel modules in Haskell

Posted Sep 17, 2009 10:56 UTC (Thu) by bboissin (subscriber, #29506)
In reply to: Writing kernel modules in Haskell by simlo
Parent article: Writing kernel modules in Haskell

Some students in my school did a small ocaml kernel som years ago, it was
booting in qemu and on real hardware.

http://gna.org/projects/funk/


to post comments

Writing kernel modules in Haskell

Posted Sep 18, 2009 14:19 UTC (Fri) by simlo (guest, #10866) [Link] (2 responses)

Last time I looked at OCAML, the implementation was bad: I used a "grand interpreter lock" (just as Python). You have to get rid of that for it to make sense.

I also disagree with the main page statement

"It could then be used as an educational tool for teaching OS design, for instance, or may be just replace Linux before Hurd goes out. "

Sorry, it is the other way around: It would be faster and more stable than any microkernel, it is just a question of optimizing the compiler. Even in very optimized assambly a microkernel will be slower - and each "service" will be more buggy since it typically will be written in C.

Writing kernel modules in Haskell

Posted Sep 18, 2009 14:30 UTC (Fri) by bboissin (subscriber, #29506) [Link] (1 responses)

Here Ocaml isn't run in interpreted mode, and maybe the GC has a global
lock but I don't think there's any other lock when Ocaml is run natively.

Secondly, I think you took that comment too seriously, the reference to
hurd shows it was meant as a joke :)
(It was just students having fun building an OS from scratch)

Writing kernel modules in Haskell

Posted Sep 19, 2009 22:41 UTC (Sat) by simlo (guest, #10866) [Link]

Well, I haven't checked again, but years ago I looked into it and that version of OCAML had something similar to the "grand interpreter lock" even though it was copiled to native code :-(

But with help from the compiler and the scheduler, it ought to be possible to make a system with no central lock - making it scale - although it will be very hard. But using an (almost) pure functional language will help in that: You for instance know that an old piece of memory can never have references to later allocated memory since it wasn't change. And in the few places where you do update a reference the compiler can put in checks to help the GC as well as the right read/write barriers for the readers on other CPUs.

Well, I can always keep on dreaming..


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds