mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
278a68cdc4
- code cleanup - the platform is now named 'sim'. You build it like this: $ scons cpu=linux The idea is to support more than one host OS by changing the "cpu" variable above (for example cpu=osx, or cpu=win32). Also, a crude "host interface" was defined in hostif.h. In theory, a host OS should only implement that interface in order to run the eLua simulator. The implementation must reside in a file called hostif_{os}.c (in this case hostif_linux.c). Too bad I don't have a MAC, I would've loved to try this :) REMEMBER: whem implementing a host interface, you CAN NOT rely on your regular libc! You'll have to rewrite the syscalls (see host.c for an example on how to do this in Linux). - after you build it, don't start it directly, use the new "run_elua_sim.sh" script to run it. It will set the terminal to raw mode, no echo, so it will behave more like "traditional" eLua (even hangman.lua will run in this mode :) ). Remember to run in on an ANSI capable terminal (although most of them support ANSI emulation nowadays). - you can exit from the simulator with "exit". You can't do this with CTRL+C if you run it with "run_elua_sim.sh". All in all, this looks pretty good and it's an excellent test platform. It will do wonders when we integrate our own libc and we won't be able to figure out why it doesn't work :)
6 lines
73 B
Bash
Executable File
6 lines
73 B
Bash
Executable File
#!/bin/bash
|
|
|
|
stty -echo raw -igncr
|
|
./elua_lua_linux.elf
|
|
stty echo cooked
|