Bitte postet das Ergebnis von folgendem Code
- NicTheQuick
- Ein Admin
- Beiträge: 8820
- Registriert: 29.08.2004 20:20
- Computerausstattung: Ryzen 7 5800X, 64 GB DDR4-3200
Ubuntu 24.04.2 LTS
GeForce RTX 3080 Ti - Wohnort: Saarbrücken
- hardfalcon
- Beiträge: 3447
- Registriert: 29.08.2004 20:46
Nein, ich hab ja auch nen anderen Wert... Nicht nur du...
Und sogar wenn's wegen deiner 2. CPU wäre: ich schreib doch keine Lib, die nur auf PC mit einer CPU funktioniert! Was passiert denn sonst, wenn der neue Pentium D sich verbreitet hat?
//EDIT: Ich *vermute*, in JEDEM PC steckt irgendein Timer, der ne Frequenz von 3579545 Hz hat, und nur in manchen PCs steckt noch ein anderer Timer, den Windows (lieber?) auswertet als den "normalen"...
Und sogar wenn's wegen deiner 2. CPU wäre: ich schreib doch keine Lib, die nur auf PC mit einer CPU funktioniert! Was passiert denn sonst, wenn der neue Pentium D sich verbreitet hat?
//EDIT: Ich *vermute*, in JEDEM PC steckt irgendein Timer, der ne Frequenz von 3579545 Hz hat, und nur in manchen PCs steckt noch ein anderer Timer, den Windows (lieber?) auswertet als den "normalen"...
- mueckerich
- Beiträge: 220
- Registriert: 13.09.2004 11:33
- Wohnort: Am schönsten Flecken der Erde, zwischen PC und Motorrad
Exaktomentehardfalcon hat geschrieben: //EDIT: Ich *vermute*, in JEDEM PC steckt irgendein Timer, der ne Frequenz von 3579545 Hz hat, und nur in manchen PCs steckt noch ein anderer Timer, den Windows (lieber?) auswertet als den "normalen"...
schau mal hier warum, ein Überbleibsel sozusagen aus der grauen Steinzeit:
Code: Alles auswählen
PC's and NTSC-525 (NTSC-M) or
"Why does the PC tick 18.2 times/second?"
The timer tick count in PC's increments about 18.2 times/second, which closely corresponds to 65536 (=10000hex) ticks per hour. Was the intention to make this exactly 65536 ticks/hour? No, this is just a concicdence.
The system clock is nominally 14.31818 MHz. This is divided by 12 to give the 1.19318166666... MHz clock to the 8253/8254 (which is often incorrectly said to be 1.193180 MHz). This frequency is divided by 65536 in channel zero of the 8253/8254 to give the timer tick rate of 18.206507364909 Hz nominal, with a cycle period of 54.92541649846559 ms nominal. There are 65543.4265 ticks in an hour.
There are 1573042.24 ticks in a day, but when the BIOS was written, the 1.19318166666... MHz frequency was approximated to 1.193180 MHz, so the BIOS writers used 1573040 (001800B0 hex) ticks per day. This contributes a 1.42166 ppm error, which is insignificant compared to the clock frequency inaccuracy (the absolute accuracy of the 14.31818 MHz clock depends mainly on the quality of the 14.31818 MHz crystal or crystal oscillator module. Initial frequency errors of +/- 20 ppm (0.002%) are common. Temperature and age will also cause frequency drift. )
1573042.24 ticks/day corresponds to 65543.43 ticks/hour, which is 0.011% more than 65536 ticks/hour - if the intention was 65536 ticks/hour exactly, they could certainly have made the agreement better than that!
The input frequency to the timer chip is 14.31818 MHz / 12 = 1.19318166666... MHz. If we instead divide by 4 we get:
14.31818 MHz / 4 = 3.579545 MHz
which is exactly the same as the NTSC-M (525 lines) colour subcarrier frequency of 3579545 Hz.
Thus it appears that the frequency of the PC's timer tick was selected in order to use the same quartz crystal to also generate an NTSC-525 colour subcarrier frequency by simply feeding the timer chip frequency into a x3 frequency multiplier. The good ol' CGA video/graphics cards are, as you may remember, able to output not just RGB video signals but also an NTSC-525 colour composite video signal, which can be fed into the video input of any NTSC-525 colour TV received.
So there we are -- the PC's somewhat odd timer tick frequency of about 18.2 ticks/s is due to NTSC's choice of colour subcarrier frequency for 525-lines, plus IBM's desire to keep down the number of quartz crystals on the original IBM PC. It also enqbled that crystal to be obtained cheaply, since it already was produced in huge volumes, for all those colour TV sets out there.
"Wenn Sie glauben, mich verstanden zu haben, dann habe ich mich falsch ausgedrückt" ( Alan Greenspan)
- ts-soft
- Beiträge: 22292
- Registriert: 08.09.2004 00:57
- Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel - Wohnort: Berlin
Für den Test hättest Wohl noch die Taktfrequenz und Hersteller der CPU erfragen sollen.
PS: AMD Athlon XP 2400+ (schon etwas verstaubt
)
PS: AMD Athlon XP 2400+ (schon etwas verstaubt
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.

Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.

- hardfalcon
- Beiträge: 3447
- Registriert: 29.08.2004 20:46
Das mit den 18,2 Mhz hab ich schonmal irgendwo gelesen. Ich glaub, das war, als ich mal in ASM einen Beep()-Befehl coden wollte (es gab mal ne Zeit, da wollte ich mein eigenes Floppy-OS coden...).
Bleibt die Frage, warum zur Hölle Windows nicht bei jedem PC den "Steinzeittimer" auswertet, sondern nur bei den meisten. Mein PC hat ja schliesslich auch nen Steinzeittimer, sonst könnte er ja gar nicht Beep_()en...
//EDIT: @ts-soft: AMD athlon XP 2400+ ?! Und das nennst du Verstaubt?! Ich hab nur nen Athlon Thunderbird 1,2 Ghz (und der H****sohn läuft auch noch nur mit 100Mhz-SD-RAM!)
Bleibt die Frage, warum zur Hölle Windows nicht bei jedem PC den "Steinzeittimer" auswertet, sondern nur bei den meisten. Mein PC hat ja schliesslich auch nen Steinzeittimer, sonst könnte er ja gar nicht Beep_()en...
//EDIT: @ts-soft: AMD athlon XP 2400+ ?! Und das nennst du Verstaubt?! Ich hab nur nen Athlon Thunderbird 1,2 Ghz (und der H****sohn läuft auch noch nur mit 100Mhz-SD-RAM!)
- hardfalcon
- Beiträge: 3447
- Registriert: 29.08.2004 20:46