Writing Device Drivers


Typical SBus systems consist of a motherboard (containing the CPU and SBus interface logic), a number of SBus devices on the motherboard itself, and a number of SBus expansion slots. An SBus can also be connected to other types of buses through an appropriate bus bridge.

The SBus is geographically addressed; each SBus slot exists at a fixed physical address in the system. An SBus card has a different address depending on which slot it is plugged into. Moving an SBus device to a new slot causes the system to treat it as a new device. See "Persistent Instances" for more information.

The SBus uses polling interrupts. When an SBus device interrupts, the system only knows which of several devices might have issued the interrupt. The system interrupt handler must ask the driver for each device whether it is responsible for the interrupt.

SBus Physical Address Space

Table 2-1 shows the physical address space layout of the Sun UltraTM 2. A physical address on the Ultra 2 consists of 41 bits. The 41-bit physical address space is further broken down into multiple 33-bit address spaces identified by PA(40:33).

Table 2-1 Device Physical Space in the Ultra 2


33-bit Space 



0x000000000 - 0x07FFFFFFF

2GB Main memory 

0x80 - 0xDF 

Reserved on Ultra 2

Reserved on Ultra 2 


Processor 0

Processor 0 


Processor 1

Processor 1 

0xE2 - 0xFD 

Reserved on Ultra 2

Reserved on Ultra 2 


0x000000000 - 0x1FFFFFFFF

UPA Slave (FFB) 


0x000000000 - 0x0FFFFFFFF

System I/O space 


0x100000000 - 0x10FFFFFFF

SBus Slot 0 


0x110000000 - 0x11FFFFFFF

SBus Slot 1 


0x120000000 - 0x12FFFFFFF

SBus Slot 2 


0x130000000 - 0x13FFFFFFF

SBus Slot 3 


0x1D0000000 - 0x1DFFFFFFF

SBus Slot D 


0x1E0000000 - 0x1EFFFFFFF

SBus Slot E 


0x1F0000000 - 0x1FFFFFFFF

SBus Slot F 

Physical SBus Addresses

The SBus has 32 address bits, as described in the SBus Specification. Table 2-2 describes how the Ultra 2 uses the address bits.

Table 2-2 Ultra 2 SBus Address Bits



0 - 27 

These bits are the SBus address lines used by an SBus card to address the contents of the card. 

28 - 31 

Used by the CPU to select one of the SBus slots. These bits generate the SlaveSelect lines. 

This addressing scheme yields the Ultra 2 addresses shown in Table 2-1. Other implementations may use a different number of address bits.

The Ultra 2 has seven SBus slots, four of which are physical. Slots 0 through 3 are available for SBus cards. Slots 4-12 are reserved. The slots are used in the following way:

SBus Hardware Configuration Files

Hardware configuration files are normally unnecessary for SBus devices. However, on some occasions drivers for SBus devices may need to use hardware configuration files to augment the information provided by the SBus card. See driver.conf(4) and sbus(4) for further details.