Re: Bits and pieces
Frode Vatvedt Fjeld <[email protected]> Mon, 02 Aug 2004 12:05:49 +0200
| Newsgroups | gmane.lisp.movitz.devel |
|---|---|
| Message-ID | <[email protected]> |
Luke Gorrie <[email protected]> writes: > Anyway. I've got a working compiler from Erlang to Lisp and I've > used it to write a "hello world" ErlangOS. But it currently only > handles the sequential subset of Erlang and that's not going to > impress my friends. So I need to add support for concurrency. Yes, this is something I'm hoping to be able to do in the not-too-distant future too (a few months). > I think a nice way to do this would be to have Lisp-level coroutines > as the building block. It looks like this is mostly written in > Movitz but I'm not sure if it's finished (couldn't figure out how to > use it). I'm looking at functions like COPY-CONTROL-STACK, > CLONE-RUN-TIME-CONTEXT, and SWITCH-TO-CONTEXT. > > Is that stuff usable? If not, what needs to be done? It's not usabel as-is. Copy-control-stack I wrote quite recently, as a debugging tool actually, but it'll clearly become a concurrency primitive also. Clone-run-time-context and switch-to-context I wrote quite a while ago trying to get some threads going, but I stopped that work for some reasone I don't remember. This means they are incomplete and possibly a bit outdated wrt. the changes in the run-time-context since then. If you want to try and make this stuff work properly for threads or coroutines or whatever, please do :) It probably requires you to figure out how the bits and pices of the run-time-context and associated structures fit together, but there's nothing really complicated in there, I believe. I'll of course answer any questions here or on #lisp. > Ideally I would like coroutines to have variable-size stacks > (growing and shrinking on demand), but that's not so important - > I'll take anything I can get :-) This should also be no problem to implement, and it's really unrelated to the concurrency stuff. Well, one issue is from where does one allocate the stack.. When there's one thread like today there's no such issue, but later one there's got to be some better global memory management. > I'd also like to do some VGA hacks. Is there any example code? There's losp/x86-pc/{vga,textmode}.lisp. The stuff in vga.lisp mostly just fiddles with the textmode registers, but I guess the graphcis stuff isn't much different. Did everyone try (x86-pc:set-textmode +vga-state-90x60+) yet, or +vga-state-40x25+ for the visually challenged? :) Luke: I suspect (setf vga-state) is what needs to be slightly improved (or even just give it the right parameters) to have graphics. Oh, and isn't it possible to have the VGA textmode be 132 wide? Does anyone know how to figure out e.g. +vga-state-132x60+ ? -- Frode Vatvedt Fjeld