2012-02-15 15:33:53 +00:00
|
|
|
#lang racket/base
|
2012-02-15 16:39:31 +00:00
|
|
|
;; Trivial example of os-userland.
|
2012-02-15 15:33:53 +00:00
|
|
|
|
|
|
|
(require "os-userland-stdlib.rkt")
|
|
|
|
|
|
|
|
(define (main)
|
|
|
|
(spawn display-driver)
|
|
|
|
(spawn read-line-driver)
|
|
|
|
(spawn sleep-driver)
|
|
|
|
(spawn (userland (lambda ()
|
|
|
|
(display "HI\n")
|
|
|
|
(sleep 1000)
|
|
|
|
(display "THERE\n"))))
|
|
|
|
(poll) ;; Wait for drivers to become ready (!)
|
|
|
|
;; The Right Way to do this is to have presence integrated with subscription
|
|
|
|
(display "Hello! Enter your name:\n")
|
|
|
|
(define name (rpc 'read-line))
|
|
|
|
(display "Hello, ")
|
|
|
|
(display name)
|
|
|
|
(display "!\n")
|
|
|
|
(sleep 1000)
|
|
|
|
(display "Goodbye\n"))
|
|
|
|
|
|
|
|
(ground-vm/stdlib (userland main))
|