X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=README.md;h=b3a41a1e2e394608b01c718de18a05340b331d35;hp=7a4153577b78afb91852b1a1b2c9bd1d36be5865;hb=HEAD;hpb=32e06b252cd46593476310508d7d8316ed103a24 diff --git a/README.md b/README.md index 7a41535..6d34b63 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,31 @@ Source structure - libs/imago/ image loading library (includes libpng, zlib, libjpeg) - libs/anim/ keyframe animation library +Coding style conventions +------------------------ +Very few style issues are mandated: + + - All filenames should be lowercase unless convention says otherwise + (`Makefile`, `README`, etc). + - All filenames under `src/` and of any tools necessary to build from MS-DOS + will have to use maximum 8.3 characters. + - Source code should be C89-compliant. Any compiler-specific features beyond + that will have to be ifdefed. + - Use tabs for indentation, where each tab is equivalent to 4 spaces. + +Everything else is left to the discretion of each individual, but also if +you're editing an existing file, try to match the style of the surrounding code. + +Some general style suggestions, which will not be enforced: + + - Don't use overly long names, abbreviate wherever it makes sense. + - Don't cast the return value of malloc. `void*` are converted implicitly, and + the cast hides forgetting to include `stdlib.h`. + - Preferably use lowercase with underscores for everything. + - Preferably use the K&R brace style if possible. + +This section will be expanded as necessary. + Building on DOS with Watcom --------------------------- Make sure you have Watcom or OpenWatcom installed, and the appropriate env-vars @@ -145,3 +170,71 @@ defined in `cdpmi.h`: #define virt_to_phys(v) ((v) + __djgpp_base_address) #define phys_to_virt(p) ((p) - __djgpp_base_address) + +Notes about moving code to/from a DOS computer +---------------------------------------------- +The easiest way to move code back and forth to a DOS computer, is to connect it +to the local network. For this you need a DOS packet driver for your NIC, which +thankfully most NIC vendors seem to provide, and a number of useful network +utilities which come with their own TCP/IP stack (mTCP and WATTCP). The +following are recommended: + + - mTCP: http://www.brutman.com/mTCP + - WATTCP: http://www.watt-32.net + - ssh2dos: http://sshdos.sourceforge.net + - rsync: http://www.2net.co.uk/rsync.html + +Here's an example batch file I'm using to set up the network: + + @echo off + c:\net\rtspkt\rtspkt 0x61 + set MTCPCFG=c:\net\mtcp\mtcp.cfg + set WATT_ROOT=c:\net\watt + set WATTCP.CFG=c:\net\watt\bin + set ETC=c:\net\watt\bin + set PATH=%PATH%;c:\net\mtcp;c:\net\watt\bin + +The rtspkt program is the packet driver for my realtek NIC, and I'm instructing +it to use interrupt 61h. The rest are environment variables needed by mTCP and +WATTCP. If you run out of environment space you might need to increase it with +`SHELL=C:\DOS\COMMAND.COM /e:1024 /p` in `config.sys`, or just put all binaries +in a single place instead of adding multiple directories to the `PATH`. + +### mTCP configuration +The `mtcp.cfg` file configures the mTCP TCP/IP stack. Go through the file, which +comes with mTCP, and make any necessary changes. For instance I've set +`packetint 0x61` to match the packet driver interrupt, and I'm using static IP +assignments, so I've set it up like this: + + ipaddr 192.168.0.21 + netmask 255.255.0.0 + gateway 192.168.1.1 + nameserver 1.1.1.1 + +### WATTCP configuration +The `wattcp.cfg` file is in the wattcp bin directory, and includes similar +configuration options: + + my_ip = 192.168.0.21 + hostname = "retrop1" + netmask = 255.255.0.0 + nameserver = 1.1.1.1 + gateway = 192.168.1.1 + domain.suffix = localdomain + pkt.vector = 0x61 + hosts = $(ETC)\hosts + +### Server-side configuration +The `pull.bat` file in the demo repo uses rsync to get the source code from the +git repo on my main GNU/Linux computer. To avoid having to type passwords all +the time, I've configures rsyncd to allow access to the demo directory in the +`/etc/rsyncd.conf` file: + + [dosdemo] + path = /home/nuclear/code/demoscene/dosdemo + comment = DOS demo project + +Since the DOS rsync utility is unfortunately read-only, the `push.bat` relies on +ssh2dos instead, which does require a password. The sshd on the server might +need to be configured to allow older encryption algorithms, depending on your +current setup.