DOS ain't dead

Fun with vDOS (Emulation)

posted by bocke, 16.03.2015, 11:10

> There's only three files: README, G.C, and (optional) CRT0.ASM , so> (famous last words) it shouldn't be that hard to recompile.> > Problem #1: G471SRC.ZIP is using an old compression method ("Implode"),> although Info-Zip still supports it. More crucial is the fact that he> probably used PKZIP, which (at least DOS version) always capitalizes the> filenames (bad!). So "G.C" [sic] is the source, which GCC thinks is C++ !!

or you can do (bash specific, can be done portably with tr):for file in *;do mv $file ${file,,};done

This will renam everythinge to lowercase.

> BTW, I'm not *nix savvy at all (in case that wasn't obvious). So I have no> clue what "caddr_t" is or how to use "mmap()" correctly. I did hack at it> to compile, and it seemed to work okay, but I might've done it wrong. It's> a bit weird to read because of the various #ifdef stuff in there (DOS,> UNIX). Honestly, I would email somebody who knows this stuff, probably> Ncurses maintainer (Thomas Dickey), to see what is going on. Though keep in> mind he'll probably just tell you to use VILE instead (which does helpfully> hop around #ifdef with '%' key).> > So I'm assuming he used mmap() for speed. I'm also assuming that the DOS> version is a fallback of a simpler way of doing things. So I assume that> will still work on Linux. So, inside Disk_to_mem(), I changed "#if DOS" to> "#if 1" and "#if UNIX" to "#if 0". Then the only problem is that O_BINARY> is undeclared, but they don't need or use that on *nix, so comment that> out.> > Then, it compiles okay for me. "echo $LINES" under ROXTerm here says "34"> (although I don't remember how, when, why, or if I set that manually). So> that's more than 25, right? So my limited testing should be acceptable> here. Okay, it runs, everything is green on black, and typing "4030" jumps> to that line. Down arrow brings me to the main text, and it seems to show> lines 4030 through 4060. So I guess it works.> > Patch follows (but beware, you need hard tabs in the makefile).> > > diff -waNBU0 old/G.C new/G.C> --- old/G.C 2015-01-07 14:21:32.000000000 -0600> +++ new/G.C 2015-01-07 14:23:25.000000000 -0600> @@ -4023 +4023 @@> -#if DOS> +#if 1 //DOS> @@ -4028 +4028 @@> -#if UNIX> +#if 0 //UNIX> @@ -4043,2 +4043,2 @@> -#if DOS> - setmode( fd, O_BINARY );> +#if 1 //DOS> + //setmode( fd, O_BINARY );> @@ -4070 +4070 @@> -#if UNIX> +#if 0 //UNIX> diff -waNBU0 old/GNUmakefile new/GNUmakefile> --- old/GNUmakefile 1969-12-31 18:00:00.000000000 -0600> +++ new/GNUmakefile 2015-01-07 14:24:33.000000000 -0600> @@ -0,0 +1,7 @@> +CC = gcc> +CFLAGS = -O2 -s -lncurses -w -x c> +> +g: G.C> + $(CC) $(CFLAGS) $< -o $@> + ls -l $@> + ldd $@>