PCMCIA Socket Services
PCMCIA Socket Services
PCMCIA Socket Services
- The PCMCIA Socket Services are called with INT lah (functions 80h and above).
- INT lah also provides the interface for clock and date functions (DOS and Real-Time Clock).
- If the function returns with a’set carry flag, an error has occurred and the ah register contains
an error code.
- Reserved or undefined bits can be ignored when read, but must be set to a value of 0 when
written.
- Section M.4 summarizes the PCMCIA Card Services.
_ The window functions refer to the memory windows in the host’s system memory.
_ The page functions manage the offset within the PCMCIA card memory.
- Socket Functions
Inquire Socket (8ch)
Get Socket (8dh)
Set Socket (8eh)
Get Status (8fh)
Reset Socket (90h)
- Window Functions
Inquire Window (87h)
Get Window (SSh)
Set Window (89h)
Get Page (8ah)
Set Page (8bh)
1290
PCMCIA Socket Services 1291
This function determines the number of installed socket service handlers and supported PCMCL4
adapters in the system. CX returns the signature ~~SS~~ (Socket Service) if at least one handler is
present. AL indicates the number of supported PCMCIA adapters (20).
‘I see M.3
This function provides various items of information about a PCMCIA socket service handler.
I) see M 3
‘I BCD
i This function returns information about a PCMCIA adapter in the system. The calling program
[ must provide a buffer and store its size (without the first four bytes) in the entry (buffer_length-
i 4) beginning at offset OOh. The socket service then returns at offset 02h the amount of informa-
j tion actually available. If that amount exceeds the buffer size, the information is truncated.
I
1292 Appendix M
‘) see M . 3
l) Buffer structure’
offset Size content
OOh word buffer-size-4
02h word data we
04h 10 bytes adapter table
Oeh word number of power entnes (num_ent)
10h num_ent+(Z Bytes) power entries
Adapter Ghle.
Offset Size content
04h 1 word bit O=\: Indicators for write-protection, card lock, battery status. busy status
XIP status shared by all sockets of the adapter
bit O=O: indicators separately for each socket
bit l=l: power supply levels shared by all sockets
bit l=O: levels separately for each socket
bit 2=1: data bus width equal for all adapter wtndows
bit 2=0: data bus width adjustable separately for all adapter windows
06h 4 bytes bit map of IRQ levels for active-high status change interrupt
Oah 4 bytes bit map of IRQ levels for active-low status change interrupt
Power em/y
10h 1 byte DC level in 1110th of volt
1 byte bit 7=1: level for Vcc. bit 6=1: level for Vppl; bit 5=1: level for Vpp2
‘) see M 3
‘I bit O=l: power down, bit O = O . e n a b l e d
b i t l=l: conflguratlon lnformatlon h e l d , bit l=O: InformatIon lost
I1 bit 6=1: IRQ for status change active-high; bit 7=0: IRQ actwe-low
bit 7=1: IRQ for status chanqe enabled; bit 8=0 IRQ d i s a b l e d
PCMCIA Socket Services 1293
.
INT lah, Function 86h - SetAdapter
c
Register Call value Return value
; This function provides information about a selected window. The calling program must supply
t a buffer and store its size (without the first four bytes) in the entry (bufieer_length-4) beginning
i at offset OOh. The socket service then returns at offset 02h the actual amount of available infor-
i mation. If this amount exceeds the buffer size, the information is truncated.
‘) see M 3
‘) bit O=l: window can map card memory Into system memory
bit l=l: wndow can map common card memory mto system memory
: bit 2=1’ wlndow can map card I/O ports Into system !iO address area
; bit 7=1 window uses WAIT for Walt states
structure for memory window:
1 )) Buffer
b Offset Size content
1 OOh word buffer_slze-4
02h word data sue
i 04h 13 bytes wlndow table
t Table for memory window.
offset Size content
IF 04h 1 word bit O=l: wlndow base address programmable, bit 0=0: base address equal FIrstByte
bit 1~1: wtndow we programmable, bit l=O we equal MmSize
t.
btt 2=1. wlndow enable/disable wthout reprogramming
1294 Appendix M
-
c
Offset Size
” see M 3
2’ II0 wndow: in bytes. memory wlndow; I” 4 kbytes
I’ btt O=l: card ports are mapped Into system VO address area; bit 0=0: card memory is mapped into system memory
bit l=l. wndow active, mapping e n a b l e d
bit 2=1: l&bit d a t a b u s width; bit 2=0: 8-bft d a t a b u s width
bit 3=1: m e m o r y wndow dlvlded Into 16.kbyte pages or IWO window uses EISA I W O m a p p i n g
bit e-1: EISA l/O m a p p i n g e n a b l e d
‘) (Olh=250 ns, 02h=200 ns, 03h=150 ns, 04h=lOO ns)
‘I see M 3
‘I i/O wlndow in bytes. memory window, I” 4 kbytes
3’ bit O=l’ card ports are mapped Into system l/O address area, bit O&O card memory IS mapped Into system memory
bit l=l. wndow acttve. mapping enabled
bit 2=1. 16-bit d a t a b u s wdth. bft 2=0: 8.bit d a t a b u s wdth
bit 3=1 m e m o r y wndow dlvlded Into 16.kbyte p a g e s or IWO wndow uses EISA l/O mapptng
bit 4=1: EISA IWO mappIng enabled
” (Olh=ZSO ns. 02h=200 ns. 03h=150 ns, 04h=lOO ns)
1296 Appendix M
This function determines the present state of the addressed page. The returned offset indicates
the card offset in Z’complement representation, which must be added to the system address to
generate the address within the PCMCIA card.
,
Register Call value Return value
‘) see M 3
‘) bit O=l: card attrlbute memory mapped Into system memory: bit C=O: card common memory mapped into system
memory
bit l=l: page enabled
bit 2=1: page write-protected
3’ in umts of 4 kbytes
This function sets the present state of the addressed page. The passed offset indicates the card
offset in 2’complement representation, which is added to the system address to generate the
address within the PCMCIA card.
” bit O=l. card attribute memory mapped into system memory; bit O=O. card common memory mapped Into system
WWllO~
bit l=l: page enabled
bit 2~1’ page write-protected
” in units of 4 kbvtes
PCMCIA Socket Services 1297
l
This function provides information about the implemented functions of the addressed socket.
I1 see M.3
z sou,ces:
bit O=l: write-protection
bit l=l: card lock device
bit 2=1: card eject
bit 3=1’ card insert
b i t 4=1 BVDl s i g n a l
bit 5=1: BVD2 slgnal
b i t 61: RDY/BSY stgnal
bit 7=1: CDx signals
j’ indicators:
b i t O=l: write-protectIon
bit l=l: card lock dewce
bit 2=1: card eject
btt 3=1. c a r d msert
bit 4-l: card lock
bit 5=1: BVDx signals
b i t 61: RDY/BSY slgnal
btt 7=1. execute In Place actwe
4 Buffer structure.
offset Size content
OOh word b i t O=l’ memory-only interface
bit l=l: memory and I/O interface
02h dword bltmap of IRQ levels for an actwe-htgh status change Interrupt
06h dword bitmap of IRQ levels for an active-low status change interrupt
This function provides information about the present state of the addressed socket.
CH Vcc level
CL Vpp IeveP
DH status change?)
DL indicator state4)
DI interfacefiR@
Carry error if 0 0
I) see M.3
2, activated mterrupt sources and occurred status changes:
b i t C=l: write-protectlon
bit l=l: card lock device
bbt 2=1: card eject
bit 3=1: card insert
bit 4=1: BVDl s i g n a l
bit 5=I: ND2 signal
bit 6=1: RDY/BSY s i g n a l
b i t 7=1: CDx signals
‘) high-mbble: Vppl; low-nibble. Vpp2
41 states.
b i t C=l: wrote-protection
bit l=l: card lock deuce
bit 2=1: card eject
bit 3=1: card insert
bit 4=1: card lock
b i t 5=1: BVDx signals
bit 6=1: RDY/BSY signal
bit 7=1: execute In Place active
‘) b i t 0..4: IRQ
bit 6=1: IREQ s i g n a l Inverted (actwe-high IRQ); bit 6-O. IREQ slgnal n o t Inverted
bit 7=1: IRQ e n a b l e d ; bit 7=0: IRQ dlsabied
bit 8=1: memory-only Interface
bit 9=1: memory and IWO interface
‘) see M.3
*I bit O=l’ write-protection
bit l=l: card lock device
bit 2=1. c a r d elect
bit 3=1. c a r d Insert
bit O-1: BVDl s i g n a l
b i t 5=1: BVD2 stgnal
bit 6=1: RDY/BSY signal
b i t 7=1. CDx signals
31 higtl-nibble: V p p l ; low-nibble Vpp2
1302 Appendix M
‘I see M.3
‘) see M.3
.
INT lah, Function 9dh - GetVendorInfo
This function provides information about the vendor. The calling program must supply a buffer
and store its size (without the first four bytes) in the entry (buffer_size-4) beginning at offset
OOh. The socket service then returns at offset 02h the amount of actual information available. If
this amount exceeds the buffer size, the information is truncated.
‘I see M.3
‘I presently only type 0 defined
” BCD format
4) Buffer structure:
offset Size content
OOh word b u f f e r we - 4 (buf_siz-4)
02h word data we
04h buf_G-4 ASCIIZ string for vendor
This function indicates which socket(s) of an addressed adapter has (have) experienced a status
change.
‘) see M 3
‘) bit O=socket 0, bit l=socket 1. etc
This function determines (Get) the entry point of the previous handler for INT lah, or sets (Set)
this entry point. It is thus possible, for example, to set the previous clock interrupt (INT lah,
functions OOh-06h) and to remove the socket service from the handler chain.
1304 Appendix M
‘) see M.3
This function provides information about code and data for the socket service handler or passes
data descriptors. The calling program must supply a buffer.
>) OOh-real mode, Olh=16:16 protected mode, 02h=16:32 protected mode, 03h=00:32 protected mode
xl OOh=SS provides Information about code and data in the buffer (Get)
Olh=SS provides Information about addltional data in the buffer (Get)
OZh=SS accepts an array with pointers to addttlonal data in the buffer (Set)
4, subfunctlon=OOh: number of addItIonal data areas (Get)
subfunctlon=Ol h: amount of information about addItIonal data areas (Get)
subfunctlork03h: number of pointers to addmonal data areas (Set)
” Buffer structure:
Subfunction=OOh.
Offset Size content
OOh dword Itnear 32.bit base address of the code segment
04h dword code segment l!mlt
08h dword offset of entry point
Och dword linear 32.bit base address of the data segment
10h dword data segment llmlt
14h dword offset of data area
SubfunctforkOlh (one entry for each addItIona/ data segmenti-
Offset Size content
OOh dword linear 32-bit base address of the data segment
04h dword data segment limit
08h dword offset of data area
Subfunction=OZh (one entry for each additiona/ data segment).
Offset Size content
OOh dword 32.btt offset
04h dword selector
08h dword reserved
PCMCIA Socket Services 1305
In a buffer, this function provides the offsets of an adapter-specific access routine to PCMCIA
cards which allow an access to the card memory only through a register, that is, I/O ports (the
usual method is mapping windows into the system memory). The calling program must supply
a buffer.
” see M 3
*I OOh=real mode, 01 h=16’16 protected mode, 02h=16.32 protected mode, 03h=00:32 protected mode
3) requested number of offsets
‘) avalable number of offsets
A call of this function leads in a defined way to a vendor-specific function. Vendors are allowed
to implement the function in any way. With the exception of AH, AL and Carry, the use of all
registers is vendor-specific, too.
c
Code Name Description
Ofh RegisterEraseQueue registers the erase queue of a client being serviced by the
card services
10h RegisterClrent registers a clrent for service by the card services
llh ResetCard resets the PCMCIA card In a socket
12h MapLogSocket maps a logical socket under card services to the physical
adapter and socket values under socket services
13h MapLogWrndow maps a window handle under card servrces to the physical
adapter and window values under socket services
14h MapMemPage maps a memory area of a PCMCIA card to a page in a
window
15h MapPhySocket maps physrcal adapter and socket values under socket
services to a logical socket under card services
16h MapPhyWtndow maps physical adapter and window values under socket
services to a window handle under card services
17h ModifyWrndow modifies the attributes or access speed of a wtndow
18h OpenMemory opens a memory card area
19h ReadMemory reads data from a PCMCIA card via a memory handle
lah RegisterMTD registers a memory technology driver MTD
lbh Release10 releases the previously requested I/O addresses
lch ReleaselRQ releases previously requested IRQs
ldh ReleaseWtndow releases previously requested system memory block
leh ReleaseConfrguration resets the socket configuration to memory-only interface
lfh Request10 requests l/O addresses for a socket
2Oh RequestlRQ requests IRQ for a socket
2lh RequestWindow request the mapping of a system memory block to a memory
area of a PCMCIA card
22h RequestSocketMask requests callback upon a socket status change (event)
23h ReturnSSEntry returns the entry pornt Into socket services
24h WriteMemory wrttes data via a memory handle onto a PCMCIA card
25h DeregisterEraseQueue removes a previously registered erase queue
26h CheckEraseQueue informs about new queue entries
27h ModifyConftguratron modifies a socket and PCMCIA card confrguration
28h RegisterTImer registers a trmer for issuing a callback (Events)
29h SetRegIon sets the properties of a PCMCIA card area
2ah GetNextClient returns the client handle for the next registered clrent
2bh ValidateUS validates the card rnformatron structure (CIS) of a PCMCIA
card
2ch RequestExclustve requests the exclusrve use of a PCMCIA card In a socket
2dh ReleaseExclusive releases the exclusive use of a card In a socket
2eh GetEventMask returns the bit map mask for Issuing an event
2fh ReleaseSocketMask releases the previously defined event mask for a socket
30h RequestConfrguratron configures the PCMCIA card rn a socket
31h SetEventMask changes the event mask
32h AddSocketServrces adds a new 55 handler below the socket servrce level
33h ReplaceSocketServrces replaces an existrng socket service handler by a new one
34h VendorSpecrfrc (vendor-dependent)
35h AdjustResourcelnfo reads or adjusts the available resources
36h AccessConfrguratronRegrster accesses a PCMCIA configuratton regrster
1308 Appendix M
M.4.2 Events
Events are reported by the socket services to the clients. Usually, events are status changes of
a socket or the inserted card.
,
Code Event Description
0th BATTERY-DEAD battery dead, data lost
02h BATTERY-LOW battery low, data still o.k.
03h CARD-LOCK mechanical
- lock has locked the inserted card
04h CARD-READY RDY/BSY signal has changed from busy to ready
05h CARD-REMOVAL card has been removed from a PCMCIA socket
06h CARD-UNLOCK mechanical lock has released the inserted card
07h EJECTION_COMPLETE card has been ejected from the socket by an automatic
ejection device
08h EJECTION-REQUEST card should be ejected from the socket by an automatrc
ejection device
09h INSERTION_COMPLETE card has been inserted into the socket by an automatic
insertion device
Oah INSERTION_REQUESl card should be inserted into the socket by an automatic
insertion device
Bbh PM-RESUME power management should power-up socket and card
Och PM-SUSPEND power management should power-down socket and card
Odh EXCLUSIVE_COMPLETE client has been granted an exclusrve access to a PCMCIA card
Oeh EXCLUSIVE_REQUEST client attempts to gc$ an exclusive access to a PCMCIA card
Ofh RESET_PHYSlCAL hardware reset for a PCMCIA card in a socket
10h RESET-REQUEST client has requested a hardware reset for a PCMCIA card in a
socket
llh CARD-RESET hardware reset for the card in a socket completed
14h CLIENT-INFO client should return information
15h TIMER-EXPIRED timer expired
16h SS_UPDATED socket support via socket services has been changed
17h WRITE-PROTECT write-protect status for the PCMCIA card which IS Inserted rn
the socket has changed
40h CARD_INSERTION a PCMCIA card has been inserted
80h RESET-COMPLETE reset rn the background complete
81h ERASE-COMPLETE erase in the background complete
82h REGISTRATlON_COMPLETE registration in the background complete
PCMCIA Socket Services 1309