vfs_spec.txt 769 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. (def tty-fs-read (fn path from len (
  2. )))
  3. (mount "/dev/tty" (list tty-fs-read tty-fs-write tty-fs-delete))
  4. (def tty (open "/dev/tty")) ; --> bytestream or null
  5. (def fb (open "/dev/fb")) ; --> bytestream or null
  6. (def put-pixel (fn x y c (
  7. (def offset (* 4 (+ x (* y fb-width))))
  8. (put fb offset c)
  9. (put fb (+ offset 1) (/ c 256))
  10. (put fb (+ offset 2) (/ c 65536))
  11. ))
  12. (def x 0)
  13. (while tty (do
  14. (def in-char (recv tty))
  15. (send tty in-char)
  16. (put-pixel x 0 0xffffff)
  17. (def x (+ x 1))
  18. ))
  19. (close tty)
  20. -------------------------
  21. shr
  22. 1. open
  23. 2. close
  24. 3. recv
  25. 4. send
  26. 3. mount
  27. -------------------------
  28. syntax sugar ideas
  29. -------------------------
  30. def tty-fs-read (fn path from len {
  31. })
  32. defn tty-fs-read path from len {
  33. concat one two
  34. }