Chetan Sakhardande wrote:
> What is a bus master device?
Something which can control the PCI bus.
> what is the difference between real, protected and virtual v86 mode, and
> where and why are these respective modes used?
In real mode, you have a 1Mbyte (20 bit) address space, which is
accessed using a 16-bit segment value and a 16-bit offset. The address
is calculated as
(segment << 4) + offset
Also, none of the protection (privilege) mechanisms are active.
In protected mode, the segment is an index (selector) into a
descriptor table. Each descriptor can refer to a separate memory
segment, which can be up to 16Mb (24 bits) on a 286 and 4Gb (32 bits)
on a 386 or above. Each segment has specific permissions.
Additionally, there are a number of privilege levels, which control
which operations can be performed.
Virtual mode is basically an emulation of real mode from within
protected mode. Memory is addressed in the same way as for real mode,
but certain operations (e.g. access to I/O ports) can be restricted.
Real mode is the only mode which the 8086 and the (seldom-used) 80186
support. All x86 processors are initially in real mode.
Protected mode is designed for multi-tasking operating systems. It
allows for access to larger amounts of memory, and allows process'
memory and I/O access to be restricted in order to maintain system
integrity.
Virtual mode is used primarily for programs such as DOSemu and
Windows' MS-DOS prompt.
See a book on 386 assembler (e.g. the yellow one from Microsoft press)
for more details.
> What is happening here ? :
>
> static int foo P((void));
>
> /* code */
>
> static int foo()
> {
> /* code
> */
> }
>
> what is the meaning of the P((void)). Why doesn't he just do static int
> foo(); there ?
I don't know about P(), but the __P() macro is defined in stdio.h as
follows:
#ifndef __P
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
#define __P(args) args
#else
#define __P(args) ()
#endif
#endif /*!__P*/
Basically, the prototype:
static int foo __P((void));
would expand to
static int foo (void);
for ANSI C and C++, and to
static int foo ();
otherwise (i.e. K&R C).
IOW, it's for making function prototypes compatible with either K&R C
or ANSI C or C++ as appropriate.
--
Glynn Clements <[EMAIL PROTECTED]>