Re: from elsewhere, an assembler
- From: /\\\\o//\\annabee <Wannabee@xxxxxxxxxxxxxxx>
- Date: Mon, 16 Apr 2007 23:07:30 +0200
På Mon, 16 Apr 2007 13:39:37 +0200, skrev Wolfgang Kern <nowhere@xxxxxxxxxxx>:
Yes, you may touch your mouse/keybd "whenever" you like.
But what happens with that IRQ if windows is too busy to serve it?
Can it choose to ignore it? Does it even know? Are some interrupts noninteruptable?
Why didnt windows process any of the mouse and keyb events when running
in realtime priority, in the admin mode, in the app I wrote to test this?
The way I see it, windows was unable to process the keyb and mouse, because
my task was preempting it. My task, have then complete control over the libraries
it runs on, and when it calles to print something, this happens without the OS driving it
in any way. The Os libs just takes the print command, pass it to a library(driver) that translate it to bytes in the memory of the videocard. Then, next time the screenbuffer is read by the videocard, it will display what is there. And I guess all this happen without the OS having anything directly todo with it. (e,g it doesnt require the OS to run any of its internal code (Its own slices) = once it has given my task its timeslice, the OS is effecivly dead?) The code path is then just like a little bloated part of my own app.
calls
App -> Os library -> Driver -> (< Videocard >) -> Screen
We could wait for an known timer-event (somewhere in API) and
synchronyse our tests to it, but I'm not sure this would help much.
The way I think about it, the moment your app has its timeslice, this timeslice is yours until you call Sleep(0) or by other means complete your processing. I agree that the timeslice maybe less then 20ms today, but in prinsiple, for the short code described here, even 1ms wount make any diffrence at all. 1ms is like an eterity on a 1,6 gHz pc. So even if the timeslice was just a microsecond , you still have ~1600 cycles before it runs out. Now clearly, I am missing something here. Windows _gave_ us the timeslice, and how does it take it back? I dont know, but much likly it _cannot_ when you run at higher prority then the system. It can take it back, any time a message has completed, or the app yields time, OR if the OS receives and are able to process its timerinterrupts. then it will be able to see that the slice is out, otherwise not. But I guess that it is NOT able todo this, if you app is running at higher priority than the OS, unless you yield your timeslice. Thats why we can deadlock the OS, mouse and keyb, without deadlocking the app. E.g if my app could read the keyboard directly, or had mousedrivers....it dont need the Os for it at all. It could go on preempting the OS, for as long as it wanted to. (I am speculating, and guessing here).
I will write some code to try to get clear about this. For instance, I try to see what happens if I open and read a file for instance, inside my intensive loop. Or call DirectInput.
First reason to need task-switching on every IRQ is the protection.
IRQ-tasks must have CPL=0/IOPL=3, otherwise it can't access I/O-ports
nor fill/read system-buffers/hw-config.
Usually this doesn't need full context TASK-switches, but any CPL
transition results in SS:ESP changes.
And that's what we measure sometimes [new stack-pages ...]
I am not so sure, but I'm willing to agree when I understand completely.
I think that wrong alignment (as you pointed out earlier) can be more important. Because I am pretty sure that a new stackpage takes >> 100000 cycles or at least a BUNCH of
cycles to proceed. Likly it takes > 1 million cycles.
Not so on KESYS, it runs the "unproteced" protected mode and
is quite happy with only one stack per CPU.
How is this possible?
:( cant be much of a pleasure.
Humour is:
laugh nevertheless, laugh aginst all odds, and laugh about yourself..
:) Just be careful that the resturant owner is not thinking you're laughing at him, but rather the aburdity that he insist you to return to the pub next door, and drink your beer there, where you bought it. Even if this is a one time event, because the girl you wore meeting had mixed up the resturants, and you allready forked out 9 EURO for a fresh new beer, but wanted to go meet her, and drink it then instead. Even if you would buy all your next ails there for hours to come. Even if the two bars are not seperated by closed doors. Even if the birds are singing and the sun is shining. Dont laugh at the poor bartender. Even if you laugh from the heart. Even if you tell him to take it away and bring you some of his instead. Once you laughed, he wount listen. Because in his little tw(o)obitter world, theres no room for exceptions. No room for reality. Just the rules. The rules are logical. The rules can not be bent. The rules must apply to all. So either you just go right away, or as in my case, you burst out in laughter, at the absurdity of this small pricks redicolous rules, just to find _3!_ guards waiting to to kick you out.
Dont know if you told about this elsewhere, but I never got the full story
there. I sometimes was thinking (in my mind when reflecting on it) that
your last post before you disappeared of the ng, was like :
"oh ***, water is running all over, help, I post later"
And then your usual nick was silent for a year or so.
Oh Yes, it was that way, followed by a not first heart-attack.
***!
(did you ever see it comming)?
[...](It is because everyone thinks I'm mad,...
mmh... I'm too familiar with this ...
but I found my way out by talking to the folks around
and telling them what's different with me :)
Yes. Once they have found a propper cubicle to put you in, then they stop worry.
I am so eager to get on with "my things" that I allmost never worry or even are
aware of my neighboors. :))
Theres something very strange in this world. Most of the interessting people, are actually criminals. Or "beside" the law. People with vibrant and flucturing minds, for which "real life" is a joke so absurd that they cant help not taking it seriously. I am more like them in that way, but I am also not a criminal. I am neither here nor there. the problem is that whereas I can accept living like this, others cannot. They need to fit me into some picture. I have no choise but to lie a litle.
...I could accept allmost anything, but reactivating the windows sounds
is inhumane. :)
More inhumane is reenabling the live-stealing 30 Sec startup delay.
:) I have some other geekfriend who claims he knows that this delay is caused by some timer. But he cant prove it, and he is not programmer. And I dont know what to make of it.
Plus that except for a very few close friends, I have next to no natural
tendency to seek companionship.
I am usually just as happy or sad, whereever I go. And more often happy
in solitude. Unless I am drunk.
Yes,
even I have to drink my level down to become more compatible :)
:)
But if you don't like to become an old isolated out-sider, you
should find some workaround to be better accepted by neighbours.
I'm blessed with a few really awsome friends. So I am not totally in the dark.
But the fact is that at this time in my life, I dont even care that much.
:)
__
wolfgang
--
.
- Follow-Ups:
- Re: from elsewhere, an assembler
- From: Wolfgang Kern
- Re: from elsewhere, an assembler
- References:
- from elsewhere, an assembler
- From: cr88192
- Re: from elsewhere, an assembler
- From: SpooK
- Re: from elsewhere, an assembler
- From: cr88192
- Re: from elsewhere, an assembler
- From: Betov
- Re: from elsewhere, an assembler
- From: Herbert Kleebauer
- Re: from elsewhere, an assembler
- From: Betov
- Re: from elsewhere, an assembler
- From: Herbert Kleebauer
- Re: from elsewhere, an assembler
- From: Betov
- Re: from elsewhere, an assembler
- From: Herbert Kleebauer
- Re: from elsewhere, an assembler
- From: Betov
- Re: from elsewhere, an assembler
- From: Wolfgang Kern
- Re: from elsewhere, an assembler
- From: /\\\\o//\\annabee
- Re: from elsewhere, an assembler
- From: Wolfgang Kern
- Re: from elsewhere, an assembler
- From: /\\\\o//\\annabee
- Re: from elsewhere, an assembler
- From: Wolfgang Kern
- Re: from elsewhere, an assembler
- From: Frank Kotler
- Re: from elsewhere, an assembler
- From: Wolfgang Kern
- Re: from elsewhere, an assembler
- From: Frank Kotler
- Re: from elsewhere, an assembler
- From: /\\\\o//\\annabee
- Re: from elsewhere, an assembler
- From: Wolfgang Kern
- Re: from elsewhere, an assembler
- From: /\\\\o//\\annabee
- Re: from elsewhere, an assembler
- From: Wolfgang Kern
- Re: from elsewhere, an assembler
- From: /\\\\o//\\annabee
- Re: from elsewhere, an assembler
- From: Wolfgang Kern
- Re: from elsewhere, an assembler
- From: /\\\\o//\\annabee
- Re: from elsewhere, an assembler
- From: Wolfgang Kern
- from elsewhere, an assembler
- Prev by Date: Re: Convert TASM Macro To NASM
- Next by Date: Re: wipe hard drive
- Previous by thread: Re: from elsewhere, an assembler
- Next by thread: Re: from elsewhere, an assembler
- Index(es):