Larry Osterman
blogs.msdn.microsoft.com/larryosterman · Personal blog · on HN since 2016
Larry Osterman, a longtime Microsoft engineer, writes about Windows internals, DOS history, and software engineering stories.
What HN saysHN commenters cite it for firsthand explanations of Windows and DOS history, threading models, and his 'one in a million is next Tuesday' essay.
41HN people shared it
32linked it in comments
9stories submitted
253story points
7 years agolast shared
2016people per year2026
Most-shared posts
- 1Why Is the DOS Path Character “”? – Larry Osterman's WebLog9 people · 3 points · first shared 2016 · 1 comments on HN
- 2One in a million is next Tuesday (2004)6 people · 2 points · first shared 2016 · discussion on HN
- 3Why no Easter Eggs? (2005)4 people · 47 points · first shared 2016 · 80 comments on HN
- 4Bill Gates: 'Why the %$#$% you need to use 64K of Ram?'3 people · 6 points · first shared 2018 · discussion on HN
- 5What’s up with the Beep driver in Windows 7? (2010)2 people · 189 points · first shared 2016 · 103 comments on HN
- 6How did we make the DOS redirector take up only 256 bytes of memory?2 people · 2 points · first shared 2017 · 1 comments on HN
- 7Faster syscall trap redux2 people · first shared 2016
- 8Fun with Names in Windows NT (2006)1 people · 4 points · first shared 2019 · discussion on HN
- 9It was 20 years ago today1 people · first shared 2016
- 10Why is it file share read and file share write anyway1 people · first shared 2018
- 11Why does win32 even have fibers1 people · first shared 2016
- 12Structured exception handling considered harmful1 people · first shared 2019
- 13Farewell to one of the great ones1 people · first shared 2018
- 14What are these threading models and why do i care1 people · first shared 2017
- 15Homepage1 people · first shared 2017
What HN people wrote when they linked it
cesarb · 2018-08-22
> E.g. in Windows, when specifying color value using COLORREF they use the BGR format 0x00bbggrr.
Wait a little bit... isn't Windows little-endian [1]? Following the link in that sentence:
> typedef DWORD COLORREF;
> The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue.
Given that Windows is and has always been little-endian, the byte order of a COLORREF is red first, then green, then blue, that is, the order is RGB. So the reason for BGR can't be Windows' COLORREF.
[1] "A decision was made VERY long ago that Windows would not be ported to a big-endian processor." https://blogs.msdn.microsoft.com/larryosterman/2005/06/07/the-endian-o…
mschaef · 2018-07-31
> a Microsoft employee discovered a way to make virtualization work with their ongoing Windows 3.x design instead of having to go with OS/2.
That's sort of right. Larry Osterman goes into more detail here, but the gist is that Microsoft figured out how to run (mostly) unchanged Win16 apps in protected mode. This was released to market in 1990 and immediately turned into the best solution to get at more than 640K RAM.... which had been a latent and mostly unresolved issue for over five years. (So lots of pent-up demand.)
https://blogs.msdn.microsoft.com/larryosterman/2005/02/02/farewell-to-…
(V86 Virtualization happened with Windows/386... another good product, but not nearly as compelling as Windows 3.0 was.)
userbinator · 2018-07-29
However, hardware context switching is no longer supported in 64-bit mode and the format of the TSS changed completely.
Quite unfortunate, especially with the large state sizes of processors now with all their vector registers and such; it would've been great to simply ask the hardware how much it needs, allocate a TSS of the appropriate size, and it would automatically manage the state save/restore as necessary.
Fun fact: in the days of the 286, which could not switch out of protected mode without a reset, the fastest way was to triple-fault:
https://blogs.msdn.microsoft.com/larryosterman/2005/02/08/faster-sysca…
rrdharan · 2017-08-04
My favorite is still the multithreaded apartment model...
https://blogs.msdn.microsoft.com/larryosterman/2004/04/28/what-are-the…
cookiecaper · 2017-04-05
"One in a million is next Tuesday" from Larry Osterman is another great reflection on this from the software perspective. [1]
[1] https://blogs.msdn.microsoft.com/larryosterman/2004/03/30/one-in-a-mil…
TimJYoung · 2016-11-07
Excellent discussion, and your points are all very much spot-on. I just wanted to add this re: Windows and fibers/threads because it is very much relevant to the conversation:
https://blogs.msdn.microsoft.com/larryosterman/2005/01/05/why-does-win…
u14408885 · 2016-03-03
Ah thank you! I currently have the MS-DOS Encyclopedia (not the first first edition https://blogs.msdn.microsoft.com/larryosterman/2004/06/14/does-anyone-… which was apparently a little _too_ detailed) which is pretty informative. I'll track down your recommendations though.
Textarcana · 2017-03-09
Wow. Thanks for the detailed response. I will try to answer point by point.
#2 that tight coupling can ever be good comes as a shock to the learner
#3 any breakage is an opportunity learn from and about failure — also when it's broken and you know that is better than if it's broken and you don't know
Regarding regression testing: writing tests is a design activity so if it is "driven" by whatever happened to break last, that sounds like treating the symptom not the underlying cause. That is why I have never been a fan of "bug-driven development" nor of large-scale regression testing.
#20 "who draws the lines" is an incredibly important political question. So who makes the declaration that the so-called black box can not or is not to be opened? This was my point. I understand what a black box means in software testing parlance.
#31 check out this great article then: https://blogs.msdn.microsoft.com/larryosterman/2004/03/30/one-in-a-mil…
#51 testing is runnable documentation and sufficiently advanced monitoring, particularly ubiquitous StatsD usage, is indistinguishable in practice from testing, see https://www.youtube.com/watch?v=uSo8i1N18oc
#66 I truly do not understand the objection you are making here. If an event goes unobserved and is without impact it is the same as if the event never occurred.
#83 no bugs always cluster at the interfaces between components
#84 Uh oh. I need to check my math and will respond further in another comment once I…
amarshall · 2019-12-19
This is from a while ago, but Microsoft once banned software easter eggs. See https://blogs.msdn.microsoft.com/larryosterman/2005/10/21/why-no-easte…
minikites · 2019-08-02
I used to like easter eggs in software but as the security landscape has changed, easter eggs now show a lack of oversight. If a programmer can slip in an easter egg, what else can they slip in?
Larry Osterman says it even better: https://blogs.msdn.microsoft.com/larryosterman/2005/10/21/why-no-easte…
macintux · 2018-11-04
https://blogs.msdn.microsoft.com/larryosterman/2005/06/24/why-is-the-d…
Update: this link adds the tidbit that IBM was concerned about 3rd party utilities that made assumptions about the slash.
https://www.howtogeek.com/181774/why-windows-uses-backslashes-and-ever…
nayuki · 2018-10-20
imron · 2018-05-29
> The other was that “impossible” things tend to happen surprisingly frequently in software.
"One in a million is next Tuesday"
https://blogs.msdn.microsoft.com/larryosterman/2004/03/30/one-in-a-mil…
kaushiks · 2017-12-18
Here's another interesting story from the DOS days:
https://blogs.msdn.microsoft.com/larryosterman/2004/11/08/how-did-we-m…
tgb · 2017-12-17
This is what one in a million looks like. https://blogs.msdn.microsoft.com/larryosterman/2004/03/30/one-in-a-mil…
shdon · 2017-04-21
I actually really like many of the blogs at Microsoft. It's a bit of a mixed bag, but there's some gems in there.
Raymond Chen's blog[1] in particular was good enough to get me to buy his book (which definitely did not disappoint).
Other ones I subscribe to are the Microsoft Edge Dev Blog[2] , Mark Russinovich[3] and Games for Windows and the DirectX SDK[4]
And there's a few that have unfortunately not been updated for a long time, such as Larry Osterman[5], or have come to an end, such as Rico Mariani[6]
[1] https://blogs.msdn.microsoft.com/oldnewthing/
[2] https://blogs.windows.com/msedgedev/
[3] https://blogs.technet.microsoft.com/markrussinovich/
[4] https://blogs.msdn.microsoft.com/chuckw/
[5] https://blogs.msdn.microsoft.com/larryosterman/
[6] https://blogs.msdn.microsoft.com/ricom/
cpeterso · 2017-04-03
Windows NT has a kernel mutex type called a "mutant" that was added for compatibility with OS/2's mutex (back when the NT team was still pretending to be building a new OS/2 kernel). Dave Cutler thought the OS/2 mutex semantics were "brain-damaged" and called NT's version "mutant". If an OS/2 thread exited while holding a mutex, the mutex would remain inaccessible forever.
https://blogs.msdn.microsoft.com/larryosterman/2004/09/24/cleaning-up-…
j_s · 2017-03-31
Windows also gets my vote when it comes to the per-app volume mixer controls which have been awesome since Windows Vista.
https://blogs.msdn.microsoft.com/larryosterman/2005/12/15/volume-contr…
pseudalopex · 2016-08-18
They used \ for directories because most DOS programs used / for switches.
https://blogs.msdn.microsoft.com/larryosterman/2005/06/24/why-is-the-d…
f393921 · 2016-07-28
I believe this is it:
https://blogs.msdn.microsoft.com/larryosterman/2005/02/08/faster-sysca…
The IBM way required IBM BIOS and an absurdly long time (as I recalled it was hundreds of milliseconds, not just milliseconds) to re-enter real mode.
The motivation was to be able to run DOS real-mode programs as well as protected mode programs.
kibwen · 2016-07-23
I think this is a bit too keen to hew to the textbook definition of "virtual machine". In modern industry practice a "virtual machine" tends to imply "we wrote an interpreter, and to run your program you execute this interpreter and feed it your program".
In the interest of being precise, I'd rather call LLVM an "abstract" machine, in the same vein as the C abstract machine defined by the C language specification (https://blogs.msdn.microsoft.com/larryosterman/2007/05/16/the-c-abstra…
yannickt · 2016-04-15
I have been wondering the same thing. Also, Larry Osterman had hinted that Gary Kimura (one of the core 12 who joined Microsoft with Cutler) had an interesting coding style, but I don't think he ever got around to writing about it. I have always been curious to know what was so interesting about it.
https://blogs.msdn.microsoft.com/larryosterman/2004/08/27/it-was-20-ye…
mappu · 2016-04-12
On the Windows side, Vista was the first client release to begin reincluding frame pointers, having omitted them since (at least) NT 3.51.
https://blogs.msdn.microsoft.com/larryosterman/2007/03/12/fpo/
yoz-y · 2016-04-07
> "More code means more bugs" implies there is no opportunity or freedom for improvement.
This twists a bit the meaning of what I have said. This particular feature is made to be throw-away and is useless. Programmers should strive to make their code as simple as possible while keeping all of the _necessary_ features of the software. This feature was not necessary.
As for the Microsoft policy here is the source:
https://blogs.msdn.microsoft.com/larryosterman/2005/10/21/why-no-easte…
Personally I would hope that the programmers' personal freedom is not expressed in easter eggs in mission critical software
simula67 · 2016-04-06
Comments in TFA also links to an official source https://blogs.msdn.microsoft.com/larryosterman/2005/06/24/why-is-the-d…
daemin · 2016-02-11
"File paths cannot contain whitespace"
That reminds me of the article (I thought it way Raymond Chen, but it's actually from Larry Osterman) about passwords being allowed to have whitespace.
https://blogs.msdn.microsoft.com/larryosterman/2008/06/03/news-flash-s…
cmdrfred · 2016-09-04
"The ADA? What on earth could the ADA have to do with a PC making a beep? Well it turns out that at some point in the intervening 25 years, the Win32 Beep() was used for assistive technologies – in particular the sounds made when you enable the assistive technologies like StickyKeys were generated using the Beep() API. There are about 6 different assistive technology (AT) sounds built into windows, their implementation is plumbed fairly deep inside the win32k.sys driver.
But why does that matter? Well it turns out that many enterprises (both governments and corporations) have requirements that prevent them from purchasing equipment that lacks accessible technologies and that meant that you couldn’t sell computers that didn’t have beep hardware to those enterprises."
Source: https://blogs.msdn.microsoft.com/larryosterman/2010/01/04/whats-up-wit… (search for ADA)
hackuser · 2016-04-05
How is it possible I didn't know that? Thank you. Does anyone know the history of it? I did a little research:
* I found someone asking the same question as me in 2005 (!) [1]
* Per someone on Stack Overflow: "/ can be used as a path separator at the API level, but you aren't calling the API directly. You're using cmd.exe, and cmd.exe parses the / as a command line option" [2]
* Later in the same Stack Overflow discussion someone performs a series of tests on Vista, with some inconsistent results. [2]
* Here's a history by veteran Microsoft developer Larry Osterman, which takes us back to the developers of MS-DOS and also mentions other undocumented ways MS-DOS can/could be made Unix friendly. [3]
-----
[1] https://bytes.com/topic/python/answers/23123-when-did-windows-start-ac…
[2] https://stackoverflow.com/questions/10523708/why-does-the-cmd-exe-shel…
[3] https://blogs.msdn.microsoft.com/larryosterman/2005/06/24/why-is-the-d…