Live data from Hacker News

How Quake.exe got its TCP/IP stack

fabiensanglard.net

131–140 of 158 posts

Re: How Quake.exe got its TCP/IP stack

#131
post #84

Earlier quoted context omitted.

And then you had Romero saying that Quake wasn't ambitious enough ...

That's the difference between an engine and game developer.

They theoretically had more than enough time for game design in the ~2 year development period, which was long for the time.

Re: How Quake.exe got its TCP/IP stack

#132

Earlier quoted context omitted.

DPMI clients don’t run in a VM, though. They’re just a normal task like any other task / process in Windows.

VM in this usage means Virtual Memory - i.e. with page tables enabled. Two "processes" can use the same memory addresses and they will point to different physical memory. In Real Address mode every program has to use different memory addresses. The VM86 mode lets you to have several Real Mode programs running, but using Virtual Memory.

VM does not mean Virtual Memory in this context. VM does mean Virtual Machine. When an OS/DPMI Server/Supervisor/Monitor provides an OS or program a virtual interface to HW interrupts, IO ports, SW interrupts, we say that OS or program is being executed in a Virtual Machine.

For things like Windows 3.x, 9x, OS/2, CWSDPMI, DOS/4G (DPMI & VCPI), Paging & Virtual Memory was an optional feature. In fact, CWSDPMI/djgpp programs had flags (using `CWSDPR0` or `CWSDPMI -s-` or programmatic calls) to disable Paging & Virtual Memory. Also, djgpp’s first DPMI server (a DOS extender called `go32`) didn’t support Virtual Memory either but could sub-execute Real Mode DOS programs in VM86 mode.

http://www.delorie.com/djgpp/v2faq/faq15_2.html

Re: How Quake.exe got its TCP/IP stack

#133

Earlier quoted context omitted.

Amen to that! I think I remember there was some communication between ID and Charles Sandmann about CWSDPMI, so even though it's worded a bit strange for an open source project there's probably some thruth in it? Also a bit strange how the author is surprised about Quake running in a 'VM', apparently they don't really know about VM86 mode in x86 processors...

DPMI clients don’t run in a VM, though. They’re just a normal task like any other task / process in Windows.

Only if they never call DOS or the BIOS or execute a Real Mode Software Interrupt. When they do, they ask the DPMI server (which could be an OS like Windows 9x or CWSDPIM) to make the call on their behalf. In doing so, the DPMI server will temporarily enter into a VM86 Virtual Machine to do execute the Real Mode code being requested.

http://www.delorie.com/djgpp//doc/libc-2.02/libc_220.html

Re: How Quake.exe got its TCP/IP stack

#134

Earlier quoted context omitted.

I wasn't allowed one either so I soldered with a screwdriver heated up on the gas stove when my parents weren't home...

That's pretty hardcore, respect :)

It also taught me valuable lessons about hardening.

Re: How Quake.exe got its TCP/IP stack

#135

Random drive-by nitpick: > From the beginning of the development, id had requested from djgpp engineers that their DPMI client would be able to run on djgpp's DPMI server but also Windows 95 DPMI server. I'm pretty sure that "DJGPP engineers" is just one guy, DJ Delorie. DJGPP was always open source so I bet he got some contributors, but if the rest of this sentence is true that "id has requested from djgpp engineers…

Back then, DJGPP was a much bigger group, and most of the Quake kudos go to Charles Sandmann, author of cwsdpmi, who worked directly with Id to help them optimize their code for our environment.

Just passing by to thank you. As many others have mentioned, DJGPP was pivotal for my life. I compiled my first C/Allegro games in DJGPP back in the mid/late 90s.

And here you are!!

Re: How Quake.exe got its TCP/IP stack

#136
post #132

Earlier quoted context omitted.

VM in this usage means Virtual Memory - i.e. with page tables enabled. Two "processes" can use the same memory addresses and they will point to different physical memory. In Real Address mode every program has to use different memory addresses. The VM86 mode lets you to have several Real Mode programs running, but using Virtual Memory.

VM does not mean Virtual Memory in this context. VM does mean Virtual Machine. When an OS/DPMI Server/Supervisor/Monitor provides an OS or program a virtual interface to HW interrupts, IO ports, SW interrupts, we say that OS or program is being executed in a Virtual Machine. For things like Windows 3.x, 9x, OS/2, CWSDPMI, DOS/4G (DPMI & VCPI), Paging & Virtual Memory was an optional feature. In fact, CWSDPMI/djgpp pr…

I agree that my comment about VM was imprecise and inaccurate.

I do dispute your assertion that virtual memory was "disabled". It isn't possible to use V86 mode (what the Intel Docs called it) without having a TSS, GDT, LDT and IDT set up. Being in protected mode is required. Mappings of virtual to real memory have to be present. Switching in and out of V86 mode happens from protected mode. Something has to manage the mappings or have set it up.

Intel's use of "virtual" for V86 mode was cursory - it could fail to work for actual 8086 code. This impacted Digital Research. And I admit my experiences are mostly from that side of the OS isle.

I did go back and re-read some of [0] to refresh some of my memory bitrot.

[0] https://www.ardent-tool.com/CPU/docs/Intel/386/manuals/23098...

Re: How Quake.exe got its TCP/IP stack

#137
> My guess is that, in full screen, memory writes and reads to the VGA are given direct access to the hardware to preserve performances. [sic]

When a DOS VM is in windowed mode, Windows must intercept VGA port I/O and video framebuffer RAM access to a shadow framebuffer and scale/bitblt it to display in its hosted window.

In full screen, exclusive VGA access is possible so it doesn't need to do anything special except restore state on task switching.

Quake would be even faster if it didn't have to support DPMI/Windows and ran in "unreal mode" with virtual memory and I/O port protections disabled.

Re: How Quake.exe got its TCP/IP stack

#138

Earlier quoted context omitted.

Back then, DJGPP was a much bigger group, and most of the Quake kudos go to Charles Sandmann, author of cwsdpmi, who worked directly with Id to help them optimize their code for our environment.

Just passing by to thank you. As many others have mentioned, DJGPP was pivotal for my life. I compiled my first C/Allegro games in DJGPP back in the mid/late 90s. And here you are!!

+1 DJGPP/Allegro key life experience on my parents Windows machine, thankyou!

Re: How Quake.exe got its TCP/IP stack

#139

I learned to solder as a pre-teen so I could make a nullmodem :) Then I learned that resistors were a thing when I made a parallel port sound card (this thing https://en.wikipedia.org/wiki/Covox_Speech_Thing ). Fun times!

Nice. I learned on a DE-9 cable making an HP-48 cable from an internal CD-ROM analog cable. I was such a poor student cliché that I used Scotch tape instead of electrical tape to ensure the RX, TX, and GND lines didn't short.

There wasn't one kind of null modem cable, per se, there were serial and parallel null modem cables.

Originally, there were null modem (serial) adapters that worked with straight through cables but that got expensive, awkward, and complicated. A universal serial null modem cable had a pair of "DB-9" DE-9 female and DB-25 female connectors on both ends so it would work with either system having either type of connector.

A parallel null modem cable had DB-25 male connectors on both ends.

http://www.nullmodem.com/LapLink.htm

Both were used with LapLink and often interchangeably called "LapLink cables" too because the boxed version of LapLink included both cables.

Re: How Quake.exe got its TCP/IP stack

#140

It's amusing to me that in the 90s you could easily play Quake or Doom with your friends by calling their phone number over the modem whereas now setting up any sort of multiplayer essentially requires a server unless you use some very user-unfriendly NAT busting.

Multi-player started with Doom 2. Original doom was single player only. Doom 2 was for 4 players which I used in my mod ArsDoom. Quake then extended it to scale via a dedicated quake server.
Post reply on HN