Link to home
Start Free TrialLog in
Avatar of kuntilanak
kuntilanakFlag for United States of America

asked on

system calls in operating system

what is the purpose of a system call in an OS?
Avatar of mr_egyptian
mr_egyptian
Flag of United States of America image

Avatar of kuntilanak

ASKER

It's not homework at all.. I just started a class in operating system and I just don't get it.. is it like a call to a program?
ASKER CERTIFIED SOLUTION
Avatar of mr_egyptian
mr_egyptian
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
is it the same basically to ask the operating system to have certain access/features that the kernel mode supplies?
Can you give me an example of an system call in windows?
From:

http://msdn.microsoft.com/en-us/library/bb540534(VS.85).aspx

Which has sample code using CreateFile, ReadFile, and WriteFile
HANDLE hFile; 
 
hFile = CreateFile(argv[1],               // file to open
                   GENERIC_READ,          // open for reading
                   FILE_SHARE_READ,       // share for reading
                   NULL,                  // default security
                   OPEN_EXISTING,         // existing file only
                   FILE_ATTRIBUTE_NORMAL, // normal file
                   NULL);                 // no attr. template

Open in new window