Click here to Skip to main content
15,905,913 members
Home / Discussions / System Admin
   

System Admin

 
GeneralRe: Urgent Help Pin
Mekong River3-Jun-05 19:01
Mekong River3-Jun-05 19:01 
Generalfolder date using bathfile Pin
Anonymous29-May-05 19:23
Anonymous29-May-05 19:23 
GeneralRe: folder date using bathfile Pin
Mekong River20-Feb-06 17:14
Mekong River20-Feb-06 17:14 
Generalintoofueil on Windows CE 5.0 Pin
Member 200235428-May-05 23:50
Member 200235428-May-05 23:50 
QuestionHow Win2K recognize the date format Pin
hanofee27-May-05 4:33
hanofee27-May-05 4:33 
Questionhow does the assembler translate Pin
not regd will du25-May-05 22:53
sussnot regd will du25-May-05 22:53 
AnswerRe: how does the assembler translate Pin
toxcct26-May-05 2:08
toxcct26-May-05 2:08 
AnswerRe: how does the assembler translate Pin
Mike Dimmick26-May-05 5:07
Mike Dimmick26-May-05 5:07 
Actually few modern compilers bother with an intermediate assembler stage, unless you actually ask for a listing. They go straight to object code.

A program as an executable file on disk isn't really runnable as-is. It's more like flat-pack furniture - all the parts are there (in theory!) but some assembly is required. The tool that assembles the program into a running memory image - a process - is the loader, a component of the OS. This creates the process, sets up the address space, loads the executable and all its dependencies (relocating libraries as required), performs the linking from import to export tables so that calls to DLLs work properly, creates a thread stack, then a thread, sets the initial thread's entry point to the address listed in the executable's header, and finally switches the processor to that thread, causing it to start executing.

What loads the loader? Various bits of the OS load each other; the OS starts loading from the disk's boot sector, which the BIOS locates and loads. The BIOS itself is run at system startup because it is electrically wired to a range of physical memory addresses starting at the point that the processor is designed to read its first instruction from.

When dealing with hardware there are two main methods of receiving input. The first is simply to read the device periodically to see if there's any data - known as polling. Polling is pretty inefficient because you have to read frequently enough to remain responsive. For example the human optical system cannot detect things that take less than about 0.04 seconds to occur - if it takes less than this it is observed as being instantaneous. You therefore need to poll at least this fast in order to give the illusion of instantaneous processing. But if the user isn't pressing any keys, it's wasteful - you could have spent that time doing something else.

In order to poll the processor must be able to read from the device. The I/O devices are therefore wired up so that when particular addresses appear on the address bus, the I/O device responds to the read request. (Some processors, like the x86 family, have a separate I/O line to distinguish I/O operations from memory operations, and corresponding IN and OUT instructions to cause this line to have a different value when using IN or OUT from that used when performing memory operations. Other processors have memory-mapped I/O, i.e. I/O devices just appear as if they're a kind of memory).

So most modern input devices use interrupts. The processor has some inputs on it known as interrupt requests (IRQs). If it detects that an interrupt is occurring, it jumps to a known location associated with that interrupt, and executes the code at that location. When processing is complete the interrupt handler uses a special return-from-interrupt instruction to continue whatever task was interrupted.

Traditionally the processor was the only device in the system that generated addresses on the address bus. All transfers from an I/O device to or from main memory had to be done explicitly in software - normally a loop that read from an I/O location (either using IN or a memory-read operation) and wrote to memory, or vice-versa. This is known as programmed I/O. Again this takes processor time that could be used for other things.

Later devices support Direct Memory Access, using bus arbitration lines on the processor to cause the processor to stop outputting addresses onto the bus, then drive the address and data buses itself. In the older architectures this caused the processor to 'stall', but with caches the processor can continue working even when it doesn't have access to main memory. The processor bus is normally a lot faster than the other buses, so the device normally only steals a relatively few cycles anyway. In this mechanism the OS simply instructs the device where to transfer data from or to, the device gets on with it, then signals via an interrupt when the operation is complete.

Stability. What an interesting concept. -- Chris Maunder
AnswerRe: how does the assembler translate Pin
Roger Wright26-May-05 18:40
professionalRoger Wright26-May-05 18:40 
GeneralWinXP defrag automated Pin
Marc Soleda25-May-05 22:19
Marc Soleda25-May-05 22:19 
GeneralRe: WinXP defrag automated Pin
Alexander M.,10-Jun-05 8:27
Alexander M.,10-Jun-05 8:27 
GeneralRe: WinXP defrag automated Pin
Mekong River20-Feb-06 17:22
Mekong River20-Feb-06 17:22 
GeneralRe: WinXP defrag automated Pin
Marc Soleda20-Feb-06 21:27
Marc Soleda20-Feb-06 21:27 
GeneralRe: WinXP defrag automated Pin
Mekong River21-Feb-06 4:07
Mekong River21-Feb-06 4:07 
QuestionBatch queue for Windows/XP ?? Pin
MartinSerrer25-May-05 7:50
MartinSerrer25-May-05 7:50 
Generale-mail Pin
Omar _25-May-05 0:13
Omar _25-May-05 0:13 
GeneralRe: e-mail Pin
toxcct25-May-05 1:47
toxcct25-May-05 1:47 
GeneralRe: e-mail Pin
MoustafaS25-May-05 3:15
MoustafaS25-May-05 3:15 
GeneralRe: e-mail Pin
toxcct25-May-05 3:18
toxcct25-May-05 3:18 
GeneralRe: e-mail Pin
MoustafaS25-May-05 3:32
MoustafaS25-May-05 3:32 
GeneralRe: e-mail Pin
albCode6-Jun-05 2:51
albCode6-Jun-05 2:51 
GeneralRe: e-mail Pin
Vasudevan Deepak Kumar11-Jun-05 3:13
Vasudevan Deepak Kumar11-Jun-05 3:13 
GeneralRecovering deleted EFS-encrypted file Pin
Levente Farkas23-May-05 20:43
Levente Farkas23-May-05 20:43 
GeneralRe: Recovering deleted EFS-encrypted file Pin
Levente Farkas2-Jun-05 1:15
Levente Farkas2-Jun-05 1:15 
Generallimited Pin
Omar _23-May-05 7:20
Omar _23-May-05 7:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.