1. PROJECT ON AUDIO CDPROJECT ON AUDIO CD
PLAYERPLAYER
MADE BY:-MADE BY:-
SANDEEP ARORA 021508048SANDEEP ARORA 021508048
SAGUN SHARMA 021508047SAGUN SHARMA 021508047
VINOD BIRLA 021508061VINOD BIRLA 021508061
GAURAV SHARMA 021508018GAURAV SHARMA 021508018
UNDER GUIDANCE OF :-
MR. SANJEEV SEHGAL
&MR. SANJEEV DHIR
2. INTRODUCTIONINTRODUCTION
• EVERYBODY IS AWARE ABOUTEVERYBODY IS AWARE ABOUT
LISTENING SONGS IN WINDOWSLISTENING SONGS IN WINDOWS
MEDIA PLAYER (WINAMP).BUT WEMEDIA PLAYER (WINAMP).BUT WE
HAVE MADEHAVE MADE
A CDPLAYER IN MSDOS TO LISTENA CDPLAYER IN MSDOS TO LISTEN
AUDIO SONGS .THIS PROJECTAUDIO SONGS .THIS PROJECT
SUPPORTS PREFETCHSUPPORTS PREFETCH
REQUESTS,SUPPORTS AUDIOREQUESTS,SUPPORTS AUDIO
CHANNEL CONTROL,SUPPORTS REDCHANNEL CONTROL,SUPPORTS RED
BOOK AND HSG ADDRESSING
3. Error codes :--Error codes :--
• 0 Write-protect violation0 Write-protect violation
• 1 Unknown unit1 Unknown unit
• 2 Drive not ready2 Drive not ready
• 3 Unknown command3 Unknown command
• 4 CRC error4 CRC error
• 5 Bad drive request structure length5 Bad drive request structure length
• 6 Seek error6 Seek error
• 7 Unknown media7 Unknown media
• 8 Sector not found8 Sector not found
• 9 Printer out of paper9 Printer out of paper
• A Write faultA Write fault
• B Read faultB Read fault
• C General failureC General failure
• D ReservedD Reserved
• E ReservedE Reserved
• F Invalid disk changeF Invalid disk change
5. Multiplex Interrupt routinesMultiplex Interrupt routines
"borrowed" from Ralf Brown's"borrowed" from Ralf Brown's
MSDOS Interrupt List v4.1MSDOS Interrupt List v4.1
• NT 21 - CD-ROM device driver - IOCTL INPUTNT 21 - CD-ROM device driver - IOCTL INPUT
• AX = 4402hAX = 4402h
• BX = file handle referencing character device for CD-ROM driverBX = file handle referencing character device for CD-ROM driver
• CX = number of bytes to readCX = number of bytes to read
• DS:DX -> control block (see #0563)DS:DX -> control block (see #0563)
• Return: CF clear if successfulReturn: CF clear if successful
• AX = number of bytes actually readAX = number of bytes actually read
• CF set on errorCF set on error
• AX = error code (01h,05h,06h,0Dh) (see #0770 at AH=59h)AX = error code (01h,05h,06h,0Dh) (see #0770 at AH=59h)
• Note:Note: the data returned depends on the first byte of the control block; thethe data returned depends on the first byte of the control block; the
• remainder of the control block is filled by the driverremainder of the control block is filled by the driver
• See Also: AX=4403h"CD-ROM",INT 2F/AX=0802hSee Also: AX=4403h"CD-ROM",INT 2F/AX=0802h
6. Values for CD-ROM dataValues for CD-ROM data
being requestedbeing requested
• 00h00h device driver header addressdevice driver header address
• 01h01h drive head locationdrive head location
• 02h02h reservedreserved
• 03h03h error statisticserror statistics
• 04h04h audio channel infoaudio channel info
• 05h05h raw drive bytes (uninterrupted and device-specific)raw drive bytes (uninterrupted and device-specific)
• 06h06h device statusdevice status
• 07h07h sector sizesector size
• 08h08h volume sizevolume size
• 09h09h media change statusmedia change status
• 0Ah0Ah audio disk infoaudio disk info
• 0Bh0Bh audio track infoaudio track info
• 0Ch0Ch audio Q-Channel infoaudio Q-Channel info
• 0Dh0Dh audio sub-channel infoaudio sub-channel info
• 0Eh0Eh UPC codeUPC code
7. Format of CD-ROM controlFormat of CD-ROM control
blockblock
• OffsetOffset SizeSize DescriptionDescription (Table 0563)(Table 0563)
• 00h00h BYTEBYTE data being requested (see #0562)data being requested (see #0562)
• ---function 00h------function 00h---
• 01h01h DWORDDWORD device driver header address (see alsodevice driver header address (see also
AH=52h)AH=52h)
• ---function 01h------function 01h---
• 01h01h BYTEBYTE addressing modeaddressing mode
• 00h HSG00h HSG
• 01h Red Book01h Red Book
• 02h02h DWORDDWORD current location of drive's headcurrent location of drive's head
• logical sector number in HSG modelogical sector number in HSG mode
• frame/second/minute/unused in Red Book modeframe/second/minute/unused in Red Book mode
• (HSG sector = minute * 4500 + second * 75 + frame -(HSG sector = minute * 4500 + second * 75 + frame -
150)150)
8. • ---function 03h------function 03h---
• 01h N BYTEs01h N BYTEs undefined as of 5 Aug 88 specificationundefined as of 5 Aug 88 specification
• ---function 04h------function 04h---
• 01h01h BYTEBYTE input channel (0-3) for output channel 0input channel (0-3) for output channel 0
• 02h02h BYTEBYTE volume for output channel 0volume for output channel 0
• 03h03h BYTEBYTE input channel (0-3) for output channel 1input channel (0-3) for output channel 1
• 04h04h BYTEBYTE volume for output channel 1volume for output channel 1
• 05h05h BYTEBYTE input channel (0-3) for output channel 2input channel (0-3) for output channel 2
• 06h06h BYTEBYTE volume for output channel 2volume for output channel 2
• 07h07h BYTEBYTE input channel (0-3) for output channel 3input channel (0-3) for output channel 3
• 08h08h BYTEBYTE volume for output channel 3volume for output channel 3
Notes:output channels 0 and 1 are left and right, 2 and 3
are left prime and right prime; a volume of 00h is off the
default setting is for each input channel to be assigned to
the same-numbered output channel at full (FFh) volume
Format of CD-ROM controlFormat of CD-ROM control
blockblock
9. • -function 05h----function 05h---
• 01h01h BYTEBYTE number of bytes readnumber of bytes read
• 02h 128 Bytes02h 128 Bytes buffer for drive bytesbuffer for drive bytes
• ---function 06h------function 06h---
• 01h01h DWORDDWORD device parameters (see #0564)device parameters (see #0564)
• ---function 07h------function 07h---
• 01h01h BYTEBYTE read moderead mode
• 00h cooked00h cooked
• 01h raw01h raw
• 02h02h WORDWORD sector size in bytessector size in bytes
• ---function 08h------function 08h---
• 01h01h DWORDDWORD volume size in sectorsvolume size in sectors
• ---function 09h------function 09h---
• 01h01h BYTEBYTE media change statusmedia change status
• 00h don't know00h don't know
• 01h media unchanged01h media unchanged
• FFh media has been changedFFh media has been changed
Format of CD-ROM control blockFormat of CD-ROM control block
10. • function 0Ah---function 0Ah---
• 01h01h BYTEBYTE lowest audio track numberlowest audio track number
• 02h02h BYTEBYTE highest audio track numberhighest audio track number
• 03h03h DWORDDWORD start address of lead-out track (Red Book format)start address of lead-out track (Red Book format)
• --function 0Bh-----function 0Bh---
• 01h01h BYTEBYTE track number (set by caller)track number (set by caller)
• 02h02h DWORDDWORD starting point of track (Red Book format)starting point of track (Red Book format)
• 06h06h BYTEBYTE track control infotrack control info
• bits 15,14,12: track type (notice: bits not contiguous!)bits 15,14,12: track type (notice: bits not contiguous!)
• 000 two audio channels, no pre-emphasis000 two audio channels, no pre-emphasis
• 001 two audio channels with pre-emphasis001 two audio channels with pre-emphasis
• 010 data track010 data track
• 100 four audio channels, no pre-emphasis100 four audio channels, no pre-emphasis
• 101 four audio channels with pre-emphasis101 four audio channels with pre-emphasis
• other reservedother reserved
• bit 13: digital copy permittedbit 13: digital copy permitted
Format of CD-ROM controlFormat of CD-ROM control
blockblock
11. Format of CD-ROM controlFormat of CD-ROM control
blockblock
• -function 0Ch----function 0Ch---
• 01h01h BYTEBYTE CONTROL and ADR byte (as received from drive)CONTROL and ADR byte (as received from drive)
• 02h02h BYTEBYTE track numbertrack number
• 03h03h BYTEBYTE point or indexpoint or index
• 04h04h BYTEBYTE minuteminute
• 05h05h BYTEBYTE secondsecond > running time within track> running time within track
• 06h06h BYTEBYTE frameframe //
• 07h07h BYTEBYTE zerozero
• 08h08h BYTEBYTE "AMIN" or "PMIN" "AMIN" or "PMIN"
• 09h09h BYTEBYTE "ASEC" or "PSEC" > running time on disk"ASEC" or "PSEC" > running time on disk
• 0Ah0Ah BYTEBYTE "AFRAME" or "PFRAME" /"AFRAME" or "PFRAME" /
• ---function 0Dh------function 0Dh---
• 01h01h DWORDDWORD starting frame address (Red Book format)starting frame address (Red Book format)
• 05h05h DWORDDWORD transfer addresstransfer address
• 09h09h DWORDDWORD number of sectors to readnumber of sectors to read
• Note:Note: copies 96 bytes of sub-channel info per sector into buffercopies 96 bytes of sub-channel info per sector into buffer
12. Format of CD-ROM controlFormat of CD-ROM control
blockblock
• function 0Eh---function 0Eh---
• 01h01h BYTEBYTE CONTROL and ADRCONTROL and ADR
bytebyte
• 02h 7 BYTEs02h 7 BYTEs UPC/EAN code (13UPC/EAN code (13
BCD digits,low-order nybble of last byte isBCD digits,low-order nybble of last byte is
0)0)
• 09h09h BYTEBYTE zerozero
• 0Ah0Ah BYTEBYTE "AFRAME""AFRAME"
13. Bitfields for CD-ROM deviceBitfields for CD-ROM device
parametersparameters
• it(s)it(s) DescriptionDescription (Table 0564)(Table 0564)
• 00 door opendoor open
• 11 door unlockeddoor unlocked
• 22 supports raw reading in addition to cookedsupports raw reading in addition to cooked
• 33 writablewritable
• 44 can play audio/video trackscan play audio/video tracks
• 55 supports interleavingsupports interleaving
• 66 reservedreserved
• 77 supports prefetch requestssupports prefetch requests
• 88 supports audio channel controlsupports audio channel control
• 99 supports Red Book addressing in addition to HSGsupports Red Book addressing in addition to HSG
• 1010 audio is playingaudio is playing
• */*/