Live data from Hacker News

What’s up with the Beep driver in Windows 7? (2010)

blogs.msdn.microsoft.com

51–60 of 106 posts

Re: What’s up with the Beep driver in Windows 7? (2010)

#51
post #25

Earlier quoted context omitted.

Author's reply concering that: Back when I made that post I thought it was an 8253. But I checked the sources for the function that Beep.Sys uses to program the timer and it claims that it’s an 8254 so I went with the source code. How hard would it be to use the chip? Not hard but now that Win7 has shipped, the number of machines with an 8254 that’s actually wired to something is going to dwindle to around 0. The mac…

There is another error in this reply. It is in the southbridge not in the Super I/O.

The SuperI/O is the part of the southbridge (which later became the ICH and nowadays is known as PCH) that implements the legacy ISA chips (RTC, 8042[1], 8254, 8257, 8259). It used to be separate, which was already an improvement over the separate integrated circuits of 30 years ago.

[1] nowadays the 8042 is mostly emulated in SMM because it needs to convert USB to PS/2.

Re: What’s up with the Beep driver in Windows 7? (2010)

#52
post #28

Earlier quoted context omitted.

There aren't ports because there isn't support anymore. Intel doesn't support AT, I don't even think it supports PS/2 with most of it's chipsets. The motherboards that do come with PS/2 usually implement their chipset. Also PS/2 stopped being electrically compatible a while ago around about the same time that the combo Keyboard/Mouse PS/2 ports became available. It offers pretty low current only about 250ma so you mi…

This stuff is in the Super I/O chip.

Super I/O is dead and gone for like well decades.

For Intel system super I/O was eaten by the ICH which initially kept compatibility with most Super I/O functions.

By ICH 6 or 7 which is around the mid 2000's most of those legacy features were all gone.

By 2008-9 the ICH was also gone and replaced by the PCH which doesn't have almost any compatibility or features with the Super I/O architecture.

Re: What’s up with the Beep driver in Windows 7? (2010)

#53

Earlier quoted context omitted.

Good luck using an AT keyboard today :P there are some USB converters. Some motherboards that offer PS/2 connectivity (rare, mostly "gaming motherboards" for n-Key rollover fanatics) but I don't even know if that chipset would do AT.

I wish it were a lot less rare as few ps/2-usb converters are very good, especially with a Model M for some reason. I don't want to retire it, it's still in great condition, unlike the dozen or more other keyboards I've had that have died after a year or two.

[deleted]

Re: What’s up with the Beep driver in Windows 7? (2010)

#54

This 8254 mention made me curious. Does anyone know which other parts of the original PC hardware are still present in modern machines for compatibility? (Real mode in CPUs, A20, ...)

Intel finally got rid of hardware A20 gating in Haskell. Real mode still exists, and iirc, the processor still defaults to it. You just can't jump into real mode from x64 mode, you need a virtualized environment in 32 bit mode to do that.

> You just can't jump into real mode from x64 mode, you need a virtualized environment in 32 bit mode to do that.

I think what you mean is the vm86 mode is not available in 64-bit protected mode (no hardware task switching and 64-bit IRET ignores EFLAGS.VM).

But you can jump into real mode from 64-bit protected mode by clearing PE and PG at the same time. There are a couple more chores to do (clear EFER.LME and CR4.PAE) if you want the real mode code to be able to enter 16- or 32-bit protected mode. This[1] is an example.

[1] https://github.com/tianocore/edk2/blob/master/MdePkg/Library...

Re: What’s up with the Beep driver in Windows 7? (2010)

#55
post #14

Earlier quoted context omitted.

FYI, it was 8253 in PC and XT, 8254 in AT. The main difference is the readback command I think. This is not the only error in this blog post BTW.

Author's reply concering that: Back when I made that post I thought it was an 8253. But I checked the sources for the function that Beep.Sys uses to program the timer and it claims that it’s an 8254 so I went with the source code. How hard would it be to use the chip? Not hard but now that Win7 has shipped, the number of machines with an 8254 that’s actually wired to something is going to dwindle to around 0. The mac…

Yeah, saw a motherboard like this a couple of years back when I was helping a friend build a new PC. We couldn't get it to boot even to the BIOS and started looking for the POST codes. There weren't even pins to attach a speaker to, just nubs on the board. Nor was there any sort of LED indicator. I ended up having to read the POST codes using a multimeter. That was a fun day.

Re: What’s up with the Beep driver in Windows 7? (2010)

#56
post #3
post #2

Anyone else remember that driver that allowed the internal speaker to output wave sound? I remember days of playing SimCity 2000 and Doom without a sound card, so it was just beeps and buzzes. Then one day I discovered that driver and started to enjoy small sounding wave sound

Yes, I remember, speaker.drv. there was also one for win 3.11. I have fond memories of squeezing Windows on a bootable 2M3.0 floppy with UC2 compression and ramdisk to use it on the dos machines in university

Searching for that filename returns some very nostalgic websites. Here's one[0], which refers to speaker.drv as a way to play audio in NCSA Mosaic. It links to SPEAK.EXE on ftp.microsoft.com; incredibly, the URL[1] still works. The page must be about 20 years old.

[0] https://boutell.com/faq/oldfaq/winsound.htm [1] ftp://ftp.microsoft.com/Softlib/MSLFILES/SPEAK.EXE

Re: What’s up with the Beep driver in Windows 7? (2010)

#57

Earlier quoted context omitted.

"So," say I, "what is the madness, The state of awful system sadness, That would cause Linux such distress?" After all, the days of yore, from which this reference came before, those days are long since gone. Yes, the PDP is long since gone, and though it legacy carries on, the once-great HACTRN is no more. So once again this begs the question, which I ask through my HN session, what did feep upon your console's bell…

...twas qmail's spool space and nothing more.

Yeah, I don't have qmail, so I don't know it qmail does that, or of it was a console thing.

Re: What’s up with the Beep driver in Windows 7? (2010)

#58
post #32

Earlier quoted context omitted.

I'm pretty sure you don't need to virtualize anything. You can switch out of long mode and then use all the pre-64 modes as normal.

On first few AMD's original AMD64 microarchitectures, 16 bit segments (both vm86 and 16b protected mode) were not working when the CPU was in long mode. The fact that they do on many modern CPUs is one of the Intel's extensions to AMD64. Also this is the reason why 64b windows do not support NTVDM and 16b windows applications, while the current hardware can support that. Another of these backward compatibility Intel'…

But you can leave long mode with a couple instructions. Was that not possible at some point? A good old triple fault should always work, shouldn't it?

Re: What’s up with the Beep driver in Windows 7? (2010)

#59

That is a pretty awesome tour de force. Somewhere deep inside your computer is an (emulated) PC/AT trying to get out :-). An interesting lesson about the use of 'beep' for the assistive technologies. I see those sorts of things in architectures which have grown up over time and I wonder whether or not you could know at the time "Hey we're using this weird thing, please deprecated at your earliest convenience" or if i…

> Also an interesting take on how much Microsoft has had to unwind in a compatible way over the years.

It's very much self-inflicted technical debt. From a Spolsky on Software article from 2004:

> Raymond Chen is a developer on the Windows team at Microsoft. He's been there since 1992, and his weblog The Old New Thing is chock-full of detailed technical stories about why certain things are the way they are in Windows, even silly things, which turn out to have very good reasons.

> The most impressive things to read on Raymond's weblog are the stories of the incredible efforts the Windows team has made over the years to support backwards compatibility:

    Look at the scenario from the customer's standpoint. You bought programs X,
    Y and Z. You then upgraded to Windows XP. Your computer now crashes
    randomly, and program Z doesn't work at all. You're going to tell your 
    friends, "Don't upgrade to Windows XP. It crashes randomly, and it's not 
    compatible with program Z." Are you going to debug your system to determine 
    that program X is causing the crashes, and that program Z doesn't work 
    because it is using undocumented window messages? Of course not. You're 
    going to return the Windows XP box for a refund. (You bought programs X, Y, 
    and Z some months ago. The 30-day return policy no longer applies to them. 
    The only thing you can return is Windows XP.)
> I first heard about this from one of the developers of the hit game SimCity, who told me that there was a critical bug in his application: it used memory right after freeing it, a major no-no that happened to work OK on DOS but would not work under Windows where memory that is freed is likely to be snatched up by another running application right away. The testers on the Windows team were going through various popular applications, testing them to make sure they worked OK, but SimCity kept crashing. They reported this to the Windows developers, who disassembled SimCity, stepped through it in a debugger, found the bug, and added special code that checked if SimCity was running, and if it did, ran the memory allocator in a special mode in which you could still use memory after freeing it.

> This was not an unusual case. The Windows testing team is huge and one of their most important responsibilities is guaranteeing that everyone can safely upgrade their operating system, no matter what applications they have installed, and those applications will continue to run, even if those applications do bad things or use undocumented functions or rely on buggy behavior that happens to be buggy in Windows n but is no longer buggy in Windows n+1.

http://www.joelonsoftware.com/articles/APIWar.html

Post reply on HN