2 ms·
> https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/io/kbd.fs https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/io/kbd... I don't know forth. Is this a
by 90s_dev 1y ago
> https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/io/kbd.fs https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/io/kbd...
I don't know forth. Is this a driver? How does it talk to the hardware?
- 7thaccount 1y agoForth is usually kind of like a macro later on top of Assembly or even machine code in the case of very simple CPUs, although it can be written on top of anything (example: Python). I think a layer on top of C is pretty common these days as the processors keep getting crazy complicated. Another important note is that although there are some conventions, almost everyone rolls their own Forth, so they're all unique in a lot of ways. The old saying is if you've seen one forth, then you've seen one forth. There is an ANS standard, but it isn't used a whole lot to my knowledge. So I assume it talks to drivers like you would with Assembly? That's just a guess and probably a bad one.
- kjander79 1y agoIt's just an event loop, watching for status changes in a memory location. Talking to the hardware just occurs when the keyboard changes the values in memory.
- skupig 1y agoThe USB host code is in fs/drv/usb: https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/drv/usb/kbd.fs https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/drv/us... Not that I can read any of it... Forth looks unlike any other language I've ever seen o_O