I am new to operating systems.I could not understand what exactly it meant when it is said
certain part of address space is reserved for i/o?
does it mean if i have 4GB RAM some part of that address is reserved for i/o?
if there is instruction such as read followed by that address is used, does cpu considers it as i/o?
Would be great help if someone clarified my understanding.
Traditionally, some computers had a separate IO and memory bus. Memory bus was connected to the memory, the IO bus was connected to the various peripherals.
For various reasons though (eg speed of access, cost of manufacturing a separate IO bus, etc.), some peripherals were mapped to memory (eg video card, where speedy access is necessary for fast graphics). This means that even though they are not (or only partly) a memory-like device, they are connected to the memory bus.
For example on microcontrollers, they usually have a common bus, that is used both for memory and IO. The reasons is that these devices has limited CPU pins and there is no need for great speed (performance is limited if you have a shared IO/memory bus)
To answer your questions:
“being reserved for IO”: this means that for these memory addresses, you should connect IO devices to the processor. Eg in case of the ATMEL microcontroller, the first 64 bytes are reserved for IO and you can use special instructions to access these easily (instead of using memory reading/writing instructions).
4GB of memory: don’t confuse logical and physical mapping of memory. In case of a PC, there is a translation device that you can program to do the translation between the two. This means, that your 4GB of physical ram can be mapped anywhere in the logical address space (that is much greater that 4GB). This means, that for those address spaces that are reserved for IO (eg the above mentioned videocard addresses), the memory is not lost, you can simply map it somewhere else in the address space.
If you use memory reading/writing operations on IO address space, this results in reading/writing the peripheral. The CPU usually has no clue that there is an IO device mapped to that address, it simply sends out the requested address to the bus and then reads the value (that is given by the peripheral instead of the memory in that case).