Title: ATM Switch WUGS
1ATM Switch WUGS
2Topics of Discussion
- Overview of WUGS
- SPC Hardware
- SPC Software
- SPC Utility
3Motivation
- Active Networking
- Network Probe
- High performance router
- PC as router is VERY limited
- (Gigabit/s Processing) on each port
4WUGS-20 Packaging
5Overview of WUGS
6Overview of WUGS(continued)
7 8The Smart Port Card
- Hardware
- SPC as a PC
- How do they each boot?
- SPC Hardware Components
- What roles do they play?
9Typical Pentium PC
CPU/Memory Bus
Addr/Data
Ctrl
Ctrl
CPU
North- Bridge
Cache
DRAM
Addr/Data/Ctrl
PCI Bus
Intr
NMI
INIT
SouthBridge (PIIX3) (PIC, PIT, )
PCI Devices
ISA Bus
ISA Devices
BIOS
Super-IO
BIOS
RTC Uarts Kbd/Mse Floppy Parallel ...
10How NetBSD Boots on a PC
- Components
- Pentium
- Boot ROM (replaced by BIOS in modern systems)
- BIOS
- Bootloader
- Kernel
11What SPC Needs
CPU/Memory Bus
12SPC Architecture
Addr/Data
Ctrl
Ctrl
CPU
North- Bridge
Cache
DRAM
Addr/Data/Ctrl
PCI Bus
NMI
INIT
Intr
APIC
PIT
PIC
RTC
UART1 Interface
BIOS ROM
Link Interface
UART2 Interface
Switch Interface
13SPC Photo
Switch Interface
DRAM
Link Interface
CPU Module
APIC
PCI Bus
System FPGA
Serial Ports
14SPC Components
- APIC
- PCI Bus Master
- Pentium Embedded Module
- 166 MHz MMX Pentium Processor
- L1 Cache 16KB Data, 16KB Code
- L2 cache 512 KB
- NorthBridge - 33 MHz, 32 bit PCI Bus
- PCI Bus Master
- System FPGA
- PCI Bus Slave
- Xilinx XC4020XLA-1 FPGA
- 20K Equivalent Gates
- 75 used
15SPC Components (continued)
- Memory
- EDO DRAM
- 64MB (Max for current design)
- Switch Interface - 1 Gb Utopia
- Link Interface - 1 Gb Utopia
- UART
- Two Serial Ports
- NetBSD system console
- TTY port
16System FPGA
- Coded in VHDL
- PCI slave device
- Replaces some of the PIIX3 (south bridge)
- Replaces some of the BIOS
- Replaces some of the Super IO Chip
- Provides reset capability
17System FPGA PIIX3 Functionality
- Programmable Interrupt Controller (PIC)
- Four Interrupts supported and statically
assigned - PIT (IRQ 0)
- APIC (IRQ 5)
- COM1 (IRQ 4)
- COM2 (IRQ 3)
- Static fully-nested interrupt priority structure.
- Specific End of Interrupt is the only EOI mode
supported - Programmable Interval Timer (PIT)
- generates a clock interrupt for NetBSD every
10ms - Reset - covered in a later slide
18System FPGA BIOS Functionality
- Interrupt functionality replaced by static values
- Simple 16 word by 32-bit ROM
- implements loop waiting for location 0xFFE00 to
change value - then jumps to boot loader code
19System FPGA Super IO Chip Functionality
- UART Interface
- Two Serial lines supported
- Fixed IRQs
- Real Time Clock
- only the register accesses of the RTC are
supported - no interrupts supported
20System FPGA Reset
- SPC needs a reset before every download
- switch reset
- causes SPC to be reset
- causes all connections in switch to be lost
- System FPGA reset
- causes SPC to be reset
- has no effect on the switch
- Normal SouthBridge reset
- I/O Register 0xCF9
- Hard Reset assert CPURST, PCIRST, and RSTDRV
- write 0xCF9 0x02 (00000010b)
- write 0xCF9 0x06 (00000110b)
- Soft Reset assert INIT
- write 0xCF9 0x00 (00000000b)
- write 0xCF9 0x04 (00000100b)
21System FPGA Reset
- SPC Reset
- a sequence of two writes to memory addresses
- APIC Control cells can write to
- memory addresses
- configuration registers
- NOT I/O Registers! Argh...
- To mimic the reset structure of the SB we use
- 0xFFFFFFF0
- 0xFFFFFFF4
- Hard Reset (all we really care about)
- write 0xFFFFFFF0 0x02 (00000010b)
- write 0xFFFFFFF4 0x06 (00000110b)
bits
22 23Software Overview
- SPC Specific Kernel Modifications
- Building a Kernel
- config
- compile
- Loading Kernel onto SPC to execute it
- download via APIC
- Initiating Kernel execution
- boot loader
- Configuring Devices
- APIC
24The Download Process
0x0
Bootloader
RESET
0x03FC
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1
Download Program
0x0FFE00
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1
0x0100000
Kernel
0xFFFFFFF0
Boot ROM
25 26Utilities - Overview
- Purpose of SPC Utilities
- glue between various software components
- simplify other parts of the system
- solve miscellaneous problems encountered
- Utilities that are still useful
- mkimg - make image
- mknl - make namelist
27mkimg - overview
- Creates a kernel image suitable for downloading
to the SPC - Removes some of the burden from the bootloader
28Kernel Image
On Disk
- This is what the NetBSD kernel in a.out format
looks like on the disk - e.g. the file /netbsd on most systems
29Kernel Image
- This is what the kernel image looks like when
loaded into memory. - Whats different?
- BSS segment has been inserted in the middle.
In Memory (as loaded by bootloader)
On Disk (e.g. the file /netbsd)
30mkimg - summary
- Kernel requires BSS segment for execution.
- Normal PC done at boot time (by the bootloader)
- SPC done by mkimg, after kernel build
- mkimg creates a copy of the kernel file with the
BSS segment included. - mkimg is invoked by make from the mk.3 script
31mknl - purpose
- Certain system tools need a kernel namelist
- ps, netstat, top, uptime, etc.
- Normally, this is read from kernel file (/netbsd)
- Problem kernel too large to fit on filesystem
- Solution
- create a file that we can put on the filesystem,
to hold the namelist information - file should look as much like the real kernel as
possible
32Kernel Image
On Disk (e.g. the file /netbsd)
- mknl utility
- input kernel in a.out format
- output the symbols only file
- approach
- open input and output files
- copy exec header
- lseek past text and data segments
- copy symbol table and string table
- close files
33a file with a hole
- mknl creates a file with a hole
- unneeded blocks are not allocated
- Example of a file with a hole
block array for the file
disk block
disk block
null
null
null
null
disk block
disk block
. . .
34output from mknl
Output file from mknl
exec header
hole (used to be text segment)
- This is what the symbols-only netbsd file looks
like - This is what we put into our filesystem as
/netbsd - Doesnt require much space
- typically around 150kB
- Example from a 24MB kernel
hole (used to be initialized data)
symbol table
string table
152 -rw-r--r-- 1 root wheel 24624114 /netbsd
35mknl - implications
- Implication of a files with holes
- Copying can produce undesirable results holes
look like blocks full of zeroes... - new file will be as large as the original kernel
- defeats purpose of mknl
- Need to mknl directly into the filesystem.
- Need to mknl after any changes are made to the
kernel.
36