Metasepi team meeting #13: NetBSD driver using Haskell

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Metasepi team meeting #13: #13: NetBSD driver using Haskell Metasepi Project / Kiwamu Okabe
Who am I? ☆ http://www.masterq.net/ ☆ Self employed software engineer ☆ Founder of Metasepi Project ☆ A developer of Ajhc ...
Agenda ☆ [1] Demo ☆ [2] What is Ajhc? ☆ [3] What is Metasepi? ☆ [4] What is compiler to build OS ☆ [5] NetBSD driver using...
[1] Demo ☆ NetBSD audio driver play sound ☆ The driver's interrupt handler rewrited using Haskell ☆ Watch the movie at fol...
Demo architecture
[2] What is Ajhc? http://ajhc.metasepi.org/ ☆ Ajhc := Arafura designed jhc ☆ jhc := John's Haskell Compiler ☆ http://repet...
Who is John? ☆ John Meacham ☆ http://repetae.net/
Why need Ajhc? ☆ GHC is de facto standard on Haskell. ☆ GHC := Glasgow Haskell Compiler ☆ http://www.haskell.org/ghc/ ☆ Wh...
[3] What is Metasepi? http://metasepi.org/ ☆ Unix-like OS designed by strong type. ☆ Using ML or more strong type lang. Ha...
Why need Metasepi? ☆ We have already Linux or Windows. ☆ But the developers are suffering. ☆ If use the kernel changed by ...
Doesn't OSS have good quality? ☆ "The Cathedral and the Bazaar" ☆ "Given enough eyeballs, all bugs are shallow." http://cr...
Low quality out of OSS umbrella
Type safety ☆ Less runtime errors. ☆ "数理科学的バグ撲滅方法論のすすめ" http://itpro.nikkeibp.co.jp/article/COLUMN/20060915/248230/
Kernel wants type desperately ☆ Kernels are developed with C lang. ☆ Error on user space => SEGV ☆ Error on kernel space =...
[4] What is compiler to build OS ☆ Need strong type. ☆ Need flexibility such as C language. ☆ Create it if there are not! ...
Want POSIX free compiler Programs to print "hoge" on terminal. The lesser depends on POSIX, the smaller values.
Jhc output has only 20 undef $ nm hs.out | grep U U U U U U U U U U U U U U U U U U U U "U " _IO_putc@@GLIBC_2.2.5 __libc...
Jhc is translator to C language
Easy to cross build
Survive burning out Let's develop with dogfooding style. (The method is called "Snatch".)
[5] NetBSD driver using Haskell ☆ Snatch target: HD Audio driver sys/dev/pci/hdaudio |-- Makefile |-- ceareg.h |-- eldreg....
Rewrited the driver entirety? ☆ No, partly
Where is Haskell code? (cont.) netbsd-arafura-s1 # <= based on NetBSD original source tree |-- BUILDING |-- GNUmakefile # ...
Where is Haskell code? (cont.) | | | | | | | | | | | | | | | | | | | | | | | |-| | | | | | | | | | | | | | | |-| | | |-| ...
Where is Haskell code? | | | | | | | | | | |-|-|-|-|-|-|-|-|-|-`-- |-|-| `-- regress rescue sbin share sys tests tools t...
How to build ☆ Install some packages $ sudo apt-get install ffmpeg qemu gcc ☆ Install Ajhc and git clone $ git clone http...
Run the kernel Run kernel on qemu $ make qemu >> NetBSD/x86 BIOS Boot, Revision 5.9 (from NetBSD 6.1.1_PATCH) >> Memory: 6...
Build process
How to call C (figure)
How to call C (code) -- File: metasepi/sys/hssrc/Sys/Bus.hs busSpaceRead4 = c_bus_space_read_4 busSpaceWrite4 = c_bus_spac...
Trace pointer chain /* C code */ static int auich_open(void *addr, int flags) { struct auich_softc *sc; sc = (struct auich...
But need assistant code!
Tool to generate the code https://github.com/ajhc/struct2hs ☆ Generate Haskell code scanning C $ struct2hs sys/dev/pci/aui...
[6] Ajhc is the best? ☆ No. ☆ Depended on GC ☆ Too buggy compiler https://github.com/ajhc/ajhc/issues ☆ Can't use MonadTra...
Before compiling (Haskell) hdaudioIntr :: Ptr HdaudioSoftc -> IO Int hdaudioIntr sc = do intsts <- hdaRead4 sc e_HDAUDIO_M...
After compiling (C language)
Debug in kernel ☆ Hardware state is sometime buggy ☆ Not only debug software ☆ but also hardware! ☆ Gap between Haskell an...
[7] From Arafura to Bohai ☆ We are in Arafura iteration ☆ Arafura := Ajhc + Snatch + NetBSD ☆ Use "ATS" compiler on the ne...
What is ATS language? http://www.ats-lang.org/ ☆ Has syntax like ML ☆ Compiled into C ☆ Dependent type ☆ Linear type ☆ Wit...
Japan ATS User Group http://jats-ug.metasepi.org/ ☆ Translating ATS documents ☆ ATS propaganda in Japan ☆ Join us!
Hongwei said... (cont.) ☆ Hongwei Xi as ATS author ☆ Associate Professor ☆ at Boston University Date: Mon Dec 23 11:40 JST...
Hongwei said... (cont.) I think I know first-handedly the dilemma you are currently one hand, you want to be able to fully...
Hongwei said... I think that we both believe C is the right language for systems programming. The problem with C is that i...
Share Slideshare
Show related Slideshows at end

AltStyle によって変換されたページ (->オリジナル) /