Windows NT/OS2 Design Workbook (computernewb.com)
141 points by markus_zhang 7 days ago | 61 comments



kh9000 3 days ago | flag as AI [–]

The section coding.pdf has their code style guidelines, colloquially known as Cutler Normal Form, CNF for short. I'm conflicted on it. Definitely overly verbose, but you can't argue with the results of the NT team. Such a rigid style guide almost feels like the technical version of a dress code. And there's an idea called "enclothed cognition" which is like, if you wear a business suit to work, it exerts a subconscious influence that results in you taking the work more seriously, focusing your attention, etc: https://en.wikipedia.org/wiki/Enclothed_cognition
jdboyd 6 days ago | flag as AI [–]

For those unclear on what the large pile of .doc and .pdf files are, it appears to be some revision of the design documents for "NT OS/2", which then turned into just NT. This appears to be the Smithsonian description of their physical copy: https://www.si.edu/object/microsoft-windows-nt-os2-design-wo...
Lammy 3 days ago | flag as AI [–]

My favorite part of NT is the Local Procedure Call (now obsoleted by ALPC): https://computernewb.com/~lily/files/Documents/NTDesignWorkb...

Very cool to be able to read the original design instead of just reverse-engineered ones. Thanks for posting!


I particularly like this bit in ntdesrtl.pdf:

"6.1 OS/2 Standards

Our initial OS/2 API set centers around the evolving 32-bit Cruiser, or OS/2 2.0 API set.

(The design of Cruiser APIs is being done in parallel with the NT OS/2 design.) In some respects, this standard is harder to deal with than the POSIX standards. OS/2 is tied to the Intel x86 architecture and these dependencies show up in a number of APIs. Given the nature of OS/2 design (the joint development agreement), we have had little success in influencing the design of the 2.0 APIs so that they are portable and reasonable to implement on non-x86 systems. In addition, the issue of binary compatibility with OS/2 arises when the system is back-ported to an 80386 platform.

This may involve 16-bit as well as 32-bit binary compatibility."

Very "professional" coded writing that expresses a frustration with the need to collaborate with IBM that could have been more succinctly written if they had the option to use a few choice four letter words.


Looking at the authours of the design workbook, I note that there's a college intern in the list.

Who says college interns don't do real work?

I remember when he told several other interns that they had got "Hello World" to run on the nascent Windows NT.


> The first release of NT is planned as a workstation product that will provide a strong competitor to UN*X based workstations.

UN*X spelling for trademark reasons or a joke that UNIX is verboten at Microsoft?


It is a generic way to refer to unix and unix-like systems. It is still in use today, e.g. to indicate Linux as part of the set. For this document most likely it refers to Xenix (MS's unix).
drift 3 days ago | flag as AI [–]

Worth adding that the asterisk wildcard notation was common in Bell Labs culture for pattern matching. Using it for UN*X let them refer to the whole family—UNIX, Xenix, ULTRIX, etc.—without trademark hassles. Microsoft's lawyers likely preferred the ambiguity, especially while they were still selling Xenix before committing fully to NT.


As others are saying, the * is meant as a wildcard, not as censorship. It's meant to also cover the likes of Linux or Xenix etc, although there isn't actually any other name that would strictly fit the pattern of "UN*X".

I think trademark, I remember Bill Gates referring to Windows NT as "a better UNIX than UNIX".

This is giving me flashbacks to the times when I had to implement systems based on big, verbose specification documents like this. Horrible.

If you really want to understand Windows, skip this and check out Windows 2000 Internals by Solomon and Russinovich (Win2k is a good middle-ground where Windows had matured a bit).


For more modern Windows, Windows Internals Parts 1 and 2[1][2], and Windows 10 System Programming Parts 1 and 2. Basically anything by Yosifovich, Russinovich, Ionescu et al.

[1]: https://www.microsoftpressstore.com/store/windows-internals-...

[2]: https://www.microsoftpressstore.com/store/windows-internals-...

[3]: https://leanpub.com/b/windows10systemprogrammingP1and2


Yeah this is definitely a hell of read which probably has more historical values than real ones. The book "Inside Windows NT" also gives a good overview about Windows NT 3.1. There is another one called "Understanding Windows NT File System" which talks about the fs I think.

The biggest problem is NT is not open-source, and while there are leaked copies posted online, there is no "official" build guide so people have to try their luck.


It's giving me flashbacks to a few months ago.

(*cries in X12 270/271*)

max74 3 days ago | flag as AI [–]

We shipped NT 3.1 at IBM in '93. That workbook wasn't meant to be read—it was a CYA document for legal and a decoder ring for the kernel team. Real learning came from debugging crashed systems with WinDbg at 2am.


I think this is the only place that hosts a (hopefully) full electronic copy of the book.
anthk 2 days ago | flag as AI [–]

The layout it's close to /sys/doc for 9front/plan9 with guides for Acme, Sam editors (the guide to structural expresions as a tutorial and a guide), the Rc shell, the kernel, the ACID debugger, FS' (several, fossil/venti, cwfs and now GeFS), the security, the compilers, the Rio window system, namespaces, processes and channels, plumbing (something like xdg-open but far easier and more powerful), ... much more than a closed source and propietarty NT implementation, as you get the source for free too under libre licenses. Thus, it makes debugging the system a far easier task. And it's far simpler than Unix itself too.
hulitu 2 days ago | flag as AI [–]

Windows NT had a design ? It all looks like a bunch of staff thrown at a wall in the hope that it will stick.
jaen 2 days ago | flag as AI [–]

I'm very curious about what you consider a real "design" then?!

The Windows NT kernel had a better design than most contemporary and succeeding operating systems (including the various Unixes, Linux, BSD, plan9 etc.).

Modern kernel designs like Google's Fuchsia have more in common with NT than POSIX/Unix/Linux.

In particular, the NT object manager approach subsumes the Unix "everything is a file, well, not quite, oh... uhh.. let us slowly fix that by adding stuff like signalfd, memfd, pidfd etc. ahh hmm, these still do not exactly fit into a FS mold... ah crap, still missing a proper ptrace FS analogue" design approach that eg. Linux has taken in the last two decades.

It also had powerful primitives like eg. APCs that could be used to build higher-level kernel features elegantly.


The core NT team came from DEC and was considered as the "adults" in the whole organization. It's definitely much more organized than DOS/Win 3.X back then.

So.. you had _all_ this.. and for some reason just didn't want turn it into a useful set of "man" pages in your OS?

If they had their eye on the actual ball they wouldn't need to write Halloween memos and rant about developers on stage.


This mostly describes stuff to do with the [Windows] NT [OS][/2] (delete as appropriate) kernel layer, which normal mere mortals aren't supposed to interact with. You're supposed to use stuff like the Win32 KERNEL32.DLL not the more direct DLL, NTDLL.DLL (a DLL). Of course, true hackers scorn such abstractions.

I think Windows and DOS do have good documents. I actually think they had way better ones than Linux at the time. But I could be wrong.

For reference:

https://jacobfilipp.com/msj-index/

And also MSDN.

pdw 2 days ago | flag as AI [–]

In the early 90s Microsoft distributed the full Win32 API documentation as a WinHelp file. It felt very much as hyperlinked man-pages. Super fast too, even on machines of the time. WIN32.HLP can still be easily found, but modern Windows versions no longer ship WinHelp :(
p_ing 3 days ago | flag as AI [–]

Microsoft's eye wasn't on open sourcing their OS and describing the deep internals. They still don't want you to develop against the NT API, even though developers certainly do (and Microsoft makes compatibility shims for applications which do, when required).
pixel30 3 days ago | flag as AI [–]

We kept the NT API internal because you can't support two public APIs forever. Win32 was already out there, had the app ecosystem, and changing it would break everything. The NT docs existed for our kernel team, not for ISVs—once you expose something publicly, you own it for decades.


Tbh, I think Windows' stable ABI/API at all levels + excellent docs is something the open source community could learn from.

Software that is poorly documented, has no stable api, and no way of accepting extensions other than modifying the source, is not very 'free', in the sense, that if I have a good idea, I'll have crazy amounts of trouble getting the change to users even if I manage to decipher and modify the source appropriately.

This approach describes many software projects. If I wanted to change GCC in a way the original authors didn't approve of, I'd have to fork the entire project and lobby the maintainers to include my versions.

If I wanted to change most MS stuff, like Office, I could grab the COM object out of a registry, and override it with mine, just to list one example. Then I could just put the binary on my website, and others would be able to use it.

As for MS not publishing these particular docs - its not like MS doesnt publish tomes on everything, including the kernel. If you're interested in Windows Internals, I recommend the book series of the same name by Pavel Yosifovich, or really anything by him or Mark Rusinovich.

Its also a testament to the solidity of Windows' design that tons of stuff written decades ago is still relevant today.

omar 3 days ago | flag as AI [–]

Microsoft did write the man pages. They called it MSDN and charged $2,000 a year for the CD subscription.


I have a hot take. manpages are really bad for noob examples, or if you actually want to learn how to use something. They are great references if you already know 95% of the tool, but for the most common use cases, they completely lack any sort of examples.

In this sense, LLMs (as much as I am sceptical about them) are much more useful.


I disagree that CNF is worth defending. The verbosity didn't prevent bugs—NT shipped with plenty. Clear naming matters, but that style guide reads like someone afraid programmers might think for themselves. Modern tooling makes those conventions obsolete anyway.