Newer
Older
An ugly hack to allow Simple_OS GUI apps to run on any port (that the user can
open), not just 2000. The program is supposed to run on a single computer, and has
caused problems on shared servers (with interference between groups).
Original code from course https://www.isy.liu.se/edu/kurs/TSEA81/ , licensed under GPL.
**Alternatively** Download the files from the course website. Replace `simple_os/src/si_comm.c` and `java-gui/java/SimpleOSComm.java` in your directory (as downloaded from the course web page). Then recompile.
Object files are (now) included, but you might want to recompile anyway.
* Clean up the library files (useful: ```simple_os/make_lib_clean```).
* Make the library files again (useful: ```simple_os/make_lib_x86_host``` or the like.)
* Recompile the GUI (in particular the communcation file, but ```javac
*.java``` in ```java_gui/java``` will do).
Note: if your system is not set up with all the requisite 32b libraries,
you might need to download those. In particular, the apt package ```gcc-multilib```
proved helpful.
## Running
Set the environment variable ```SIMPLE_OS_PORT``` and make sure that
it is exported. Like so (bash syntax):
* Ports below 1024 are banned, since you shouldn't run this with system privileges (and this is required in those cases).
* Ports above 49152 should be ephemeral (https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#cite_ref-345).
* Avoid ports that are already in use. A simple heuristic scheme (in the absence of random generators) might be to **start with port `5mmdd`** where MMDD is your month and day of birth.
* In general: don't scan for open ports automatically, even if you can. IT security will likely frown upon this.
* This should be a rather general solution, but compilation instructions for eg Windows is left to the interested user. Always refer back to the course!
* **If this opens a port on a non-firewalled computer reachable from the internet, and the software is vulnerable, it's probably a bad idea to run it. Regardless of which port you use.**