Re: countdownEvent in BOCHS
Xin Tong <[email protected]>
| Newsgroups | gmane.comp.emulators.bochs.devel |
|---|---|
| Message-ID | <CALKntY1fExuRrykcqca84dMMJOg+cjkb=MUwEGm9tWM5-7V5aA@mail.gmail.com> |
On Tue, Oct 2, 2012 at 2:57 PM, Stanislav <[email protected]> wrote: > The async_event is nothing more than just an indication that CPU should > check for external events. > The events themselves are not necessary have to be pending at this time, not too sure about what you mean by events here. can you please give an example ? Xin > moreover setting the bit alone as is won't cause any side effect. > The interrupts delivered to CPU through PIC, I/O APIC or APIC or by raising > external pins like SMI/NMI > > Stanislav > > -----Original Message----- > From: Xin Tong [mailto:[email protected]] > Sent: Tuesday, October 02, 2012 7:46 PM > To: Volker Ruppert > Cc: [email protected] > Subject: Re: [Bochs-developers] countdownEvent in BOCHS > > On Tue, Oct 2, 2012 at 1:23 PM, Volker Ruppert <[email protected]> > wrote: >> Hi! >> >> >>> so no immediate interrupt is generated when the keystroke is received >>> from the keyboard ? rather, the interrupt is only generated when the >>> timer fires and the input buffer of keyboard is checkd ? >> >> >> That's right. The keyboard controller should not generate interrupts >> faster than it happens on real hardware. Note that the keyboard and >> mouse interrupts are only generated if enabled in the controller (and >> of course in the PIC). The timer handler also manages the paste >> feature. When pressing the paste button in the Bochs header bar, text >> data can be sent to the keyboard controller. A delay is required >> between each character to avoid a buffer overflow. The keyboard does not > yet emulate the typematic feature. >> The delay and characters per second depend on the host settings. When >> implementing this feature, most of the job must be done by the timer >> handler. > > so lets say i press a key on my computer keyboard. it will raise an > interrupt on my physical machine. the character is read and stored in a > BUFFER A. this BUFFER A is then later copied to a BUFFER B (in bochs > emulated keyboard) in bochs and bochs checks for what is in BUFFER B when a > timer fires. > > 2 questions. > > 1. when and how is the copying done from BUFFER A to BUFFER B ? > 2. why can not the same thread set a bit in the BX_CPU_C async_event bit to > force the checking of BUFFER B ? > > Xin > >> >> >>>> The timer for the gui event handler is located in the devices.cc >>>> code. It calls bx_gui->handle_events() every 1 millisecond. >>> >>> >>>> This method sends the >>>> keyboard / mouse data to the buffer of the emulated device. >>>> >>> can you explain this a bit more ? >> >> >> The gui event handler is always called from the simulation thread >> (timer handler in devices.cc). If there is only one thread, the code >> polls outstanding events from the library used (e.g. X11, SDL). Mouse >> events can be sent directly to the hardware emulation (PS/2 , USB). >> Keyboard events must be translated to BX_KEY_* constants. If necessary >> (and enabled) a remap of the localized keyboard layout to the U.S. one >> is handled. In a multi-threaded environment (rfb, win32, wx) the gui >> thread detects events and stores them in a queue. The gui method >> handle_events() only has to read from this queue and continues processing > events as described above. >> >> Our development docs still have some empty sections. Some parts of >> this text might be useful there. >> >> -- >> Thanks >> >> Volker >> > > ---------------------------------------------------------------------------- > -- > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly what is > happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at > no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > bochs-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/bochs-developers > ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev