3 ms·
A lot would need to change with the language to make it suitable for OS development I keep hearing this, or statements along these lines. But I never see an ex
by ehsanu1 14y ago
A lot would need to change with the language to make it suitable for OS development
I keep hearing this, or statements along these lines. But I never see an explanation for this. Performance? Managing memory from other processes? Bit twiddling required to create device drivers? Something else? Are these insurmountable?
- pnathan 14y agoTo write an OS, you need to have a few things: - ability to manually access memory - ability to use assembly and translate said assembly into the high-level language - ability to install interrupts You probably also want the ability to precisely constrain the amount of memory a block of code uses. I suppose there are other nice to haves as well: e.g., GC will need to be fairly controllable. I see no practical reason why a Lisp can't be used to write an OS, but that Lisp will need a few extensions from the usual modern Lisp capabilities.
- JonnieCache 14y ago>- ability to use assembly and translate said assembly into the high-level language Can you elaborate as to exactly what you mean here?
- pnathan 14y agoIn C, I can do something like this (pardon my rusty x86/intel syntax): int variable = 0xdeadbeef; __asm { ldw eax, $(variable) # load from variable int 0x3 # trip interrupt.. maybe read from a IO port or something. stw $(variable), $eax # get result, put into C variable } return variable; This allows me to express certain things to the computer that are outside the range of expressibility of the language model. What I would like to be able to do in Lisp is to execute the semantic equivalent of the above code fragment. I've considered hacking it into SBCL, but I have had higher priorities so far.
- mtrimpe 14y agoThis would be a good start. (mov :ax :ds) (push :cx)
- masklinn 14y ago> - ability to use assembly and translate said assembly into the high-level language Not at all, lisp machines used custom silicon implementing lisp in hardware, I believe even the microcode was lisp. > I suppose there are other nice to haves as well: e.g., GC will need to be fairly controllable. If you're coding the hardware to the language, parts of the GC can be hardware-supported directly. > I see no practical reason why a Lisp can't be used to write an OS Especially since it has been used to write OSes, multiple times.
- pnathan 14y agoOkay, I was making the assumption of using standard x86-style hardware. :-)