Welcome to Dream.In.Code
Become a C++ Expert!

Join 150,051 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,701 people online right now. Registration is fast and FREE... Join Now!




dos.h functions

 
Reply to this topicStart new topic

dos.h functions, Information about the functions

Rectorrite
2 Jun, 2008 - 08:43 AM
Post #1

New D.I.C Head
*

Joined: 2 Jun, 2008
Posts: 1

Well, I have been programming in C and C++ for the last 4 years. Now, I intend to move further and deeper. Can anyone tell me how can I know the details of library functions such as 'biosdisk(), absread(), abswrite()' etc in dos.h header file. By detail, I mean how these functions are developed, the code that goes into the making of it, the core of it.

Please help me or give me suggestions.

Rector


User is offlineProfile CardPM
+Quote Post

perfectly.insane
RE: Dos.h Functions
2 Jun, 2008 - 03:43 PM
Post #2

D.I.C Addict
Group Icon

Joined: 22 Mar, 2008
Posts: 581



Thanked: 46 times
Dream Kudos: 25
Expert In: C/C++

My Contributions
Well, more than likely, these functions are either implemented in assembly, use inline assembly, or call some special generic syscall functions written in assembly.

Accessing a hard disk using the BIOS calls involves raising the software interrupt 13h. This includes setting the CPU registers to the needed values to communicate the desired action, which are then interpreted by the interrupt handler.

Here's a list of the services that int 13h provides:
http://en.wikipedia.org/wiki/INT_13

absread and abswrite, even though I've never used them, more than likely refer to interrupts 25h/26h (absolute disk read/absolute disk write). These services are provided by the DOS kernel (IO.SYS), but I believe they are a very thin wrapper around INT 13h services.

If you're wondering if you can access the disks directly in modern operating systems in this way, the answer is usually no. They can be accessed directly, but usually through some other interface of sorts (a device / hardware abstraction layer). It's not that you can't trigger interrupts (and software interrupts are still the primitive here), but it's just that the OS does not provide a specific interface for reading/writing disks... it provides an interface for reading and writing to devices in a generalized manner, and device specific functionality is implemented through IOCTLs upon handles issues by the OS.

This post has been edited by perfectly.insane: 2 Jun, 2008 - 03:52 PM
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Dos.h Functions
3 Jun, 2008 - 01:47 AM
Post #3

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,032



Thanked: 38 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Here's the complete list of dos.h functions, macros and constants:

Functions and Macros:
  • allocmem
  • bdos
  • bdosptr
  • _chain_intr
  • _chmod
  • country
  • ctrlbrk
  • delay
  • disable
  • _dos_allocmem
  • _dos_close
  • _dos_commit
  • _dos_creat
  • _dos_creatnew
  • dosexterr
  • _dos_findfirst
  • _dos_findnext
  • _dos_freemem
  • _dos_getdate
  • _dos_getdiskfree
  • _dos_getdrive
  • _dos_getfileattr
  • _dos_getftime
  • _dos_gettime
  • _dos_getvect
  • _dos_keep
  • _dos_open
  • _dos_read
  • _dos_setblock
  • _dos_setdate
  • _dos_setdrive
  • _dos_setfileattr
  • _dos_settime
  • _dos_setvect
  • dostounix
  • _dos_write
  • _emit_
  • enable
  • FP_OFF
  • FP_SEG
  • geninterrupt
  • getcbrk
  • getdate
  • getdfree
  • getdta
  • getfat
  • getfatd
  • getftime
  • getpsp
  • gettime
  • getvect
  • getverify
  • _harderr
  • _hardresume
  • _hardretn
  • inport
  • inportb
  • int86
  • int86x
  • intdos
  • intdosx
  • intr
  • keep
  • MK_FP
  • nosound
  • outport
  • outportb
  • parsfnm
  • peek
  • peekb
  • poke
  • pokeb
  • randbrd
  • randbwr
  • segread
  • setcbrk
  • setdate
  • setdta
  • settime
  • setvect
  • setverify
  • sleep
  • sound
  • unixtodos
  • unlink

Constants, Data Types and Global Variables
  • _8087
  • _argc
  • _argv
  • COUNTRY
  • date
  • devhdr
  • dfree
  • diskfree_t
  • dosdate_t
  • DOSERROR
  • dostime_t
  • _doserrno
  • dosSearchInfo
  • errno
  • _environ
  • fatinfo
  • fcb
  • FA_*
  • ffblk
  • _heaplen
  • NFDS
  • _osmajor
  • _osminor
  • _osversion
  • _ovrbuffer
  • _psp
  • REGPACK
  • REGS
  • SEEK_CUR
  • SEEK_END
  • SEEK_SET
  • SREGS
  • _stklen
  • time
  • _version
  • xfcb

Source : Borland C++ 5.02 Help Files
User is online!Profile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 10:16PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month