dos.h functions

Information about the functions

Page 1 of 1

2 Replies - 35246 Views - Last Post: 03 June 2008 - 02:47 AM Rate Topic: ***** 1 Votes

#1 Rectorrite  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-June 08

dos.h functions

Posted 02 June 2008 - 09:43 AM

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
Is This A Good Question/Topic? 0
  • +

Replies To: dos.h functions

#2 perfectly.insane  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 70
  • View blog
  • Posts: 644
  • Joined: 22-March 08

Re: dos.h functions

Posted 02 June 2008 - 04:43 PM

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: 02 June 2008 - 04:52 PM

Was This Post Helpful? 0
  • +
  • -

#3 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: dos.h functions

Posted 03 June 2008 - 02:47 AM

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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1