Name: Anonymous 2009-12-26 19:45
Write an operating system capable of outputing Sussmen. Prove its correct operation by outputing a Sussman once the boot sequence is complete.
main = putStrLn "Sussman"
ORG 0x7c00
push cs
pop ds
mov si, sussman
xor ax, ax
mov bx, 7
mov cx, 7
mov ah, 14
loop:
lodsb
int 0x10
loop loop
hcf
sussman db 'Sussman'{-# LANGUAGE ScopedTypeVariables #-}
import qualified Control.Exception as E
import System.Environment
import System.IO
main = mapM_ resize =<< getArgs
resize path = E.handle eh $ withBinaryFile path ReadWriteMode (flip hSetFileSize (1440 * 1024))
where eh (e :: E.SomeException) = hPutStrLn stderr $ path ++ ": " ++ show e