| Paste number 48713: | ryuu first kernel (yay) |
| Pasted by: | thoughtpolice |
| 1 year, 1 month ago | |
| None | |
| Paste contents: |
| [austin@continuum kern]$ cat ryuu.hs -- this is the first kernel i'm writing for ryuu. it doesn't do anything, -- but it proves we get the runtime/libs working. once we can load this -- successfully, we can write more interesting parts of the kernel module Ryuu where import Control.Concurrent ( forkIO, threadDelay ) import Text.Printf thr :: Int -> IO () thr n = say (if (n `mod` 2 == 0) then "fizz!\n" else "buzz!\n") >> threadDelay 1000 >> thr n where say s = printf "thr[%d]: \t%s" n s launch :: Int -> (Int -> IO ()) -> IO () launch 0 _ = threadDelay 50000000 launch n f = forkIO (f n) >> launch (n-1) f main = do putStrLn "hello, world! this is haskell in ring 0!" launch 10 thr [austin@continuum kern]$ |
This paste has no annotations.