Hacker News new | comments | show | ask | jobs | submit login
The JOS Window System (ryanrussell.me)
27 points by ingve 10 months ago | hide | past | web | favorite | 8 comments

Hey everyone. Didn't expect to see this here. I made this for my operating systems class a few years ago. Unfortunately I can't share the code because the rest of the OS is used as assignments for the class, but it was a fun project.

It's not highlighted much in the writeup, but most of the interaction takes place in the terminal. The original assignments just use text mode. The graphics mode got started when I tried to implement ANSI escape codes in the terminal, but some of the effects weren't possible in text mode. I changed the bootloader to switch the system into a known graphics mode, then implemented a terminal emulator on top of that. From there it was just a small matter of mouse drivers and windowing commands.

JOS is a unix-inspired exokernel. It has virtual memory with thread isolation, a pre-emptive scheduler (round-robin, I think), and IPC. Everything else lives in user-land. As alluded to, the disk drivers even run in a user-land process which has been given access to the disk IO port. My windowing system is also a user-land process, which leases out buffers of memory as windows and has been given access to the memory-mapped screen buffer.

RE: transparency

see https://en.wikipedia.org/wiki/Bit_blit

This was used for sprites on pretty much any 1980s target that didn't support hardware sprites.

FYI the webpage doesn't work correctly maximized in firefox at 1080p; the image overlaps the text. Shrinking the window allows me to read it, but something is wrong in your responsive stylesheet.

JsonTransform[1] by the same author made me giggle.

"Transforms JSON to JSON using JSON"


Haha, my Github has some projects of questionable usefulness, yeah. In that case, I was building a UI for an internal monitoring app at an internship. It had to make requests to lots of internal API and couldn't really ask for custom endpoints or changes. Having a declarative way to transform the responses into UI models was really useful. That also explains the '!json' operator, because inevitably in legacy systems there will be responses that contain stringified JSON that needs to be parsed.

For fun, you should make sure to make the identity transform be super complex, like it is for XSLT:


Um, it's been a while, but I think it fails that test -- the identity template is "$"

Ah finally! XSLT for the JSON age :)

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact