Embedded XINU and WRT 54 GL 1292022 1
Embedded XINU and WRT 54 GL 1/29/2022 1
Topics n Logic and shift operators n Optimizing operations (mul, div VS shift. L, shift. R) n WRT 54 GL architecture and internals n Embedded XINU 1/29/2022 2
Shift Operators n << left shift n >> right shift Usage: unsigned int x = 70707; //x = 000000010100 0011 unsigned int y, z; y = x << 2; // y = 00000100 01010000 1100 z = x >> 2; //z = 00000000 01000101 00001100 1/29/2022 3
Logic Operators Bitwise & (AND) Bitwise inclusive | (OR) Bitwise exclusive ^ (XOR) Bitwise negation ~ Usage: unsigned exp 1 = 1; unsigned exp 2 = 4; printf (“ %dn”, exp 1 | exp 2); printf (“ %dn”, exp 1 & exp 2); printf (“ %dn”, exp 1 ^ exp 2); printf (“ %dn”, ~exp 1); n n 1/29/2022 4
Relevance of shift and logic operators n Bitwise operations are necessary for much low-level programming, such as writing device drivers, low-level graphics, communications protocol packet assembly and decoding. n Device drivers use these operators to test the presence or absence of a bit in a serial port or a device input. (checking for on or off) 1/29/2022 5
WRT 54 GL n History of WRT 54 G Open source firmware n Common features n Processor architecture (BCM 5352) n WRT 54 GL Block diagram
History n Introduced in 2002 n In 2003 Andrew Miklas posted to Linux Kernel Mailing List about Linksys using GPL code in its firmware n Linksys executives gave into the pressure from the community, Linksys released the code to the community under GPL.
Common Features n Power: 12 VDC 1. 0 amp n This power requirement is standard for embedded devices and wireless access points n This makes them compatible with Power over Ethernet (Po. E) n This especially significant in mobile environment. n The Reset button: to reset the configuration
Common Features (Contd. ) n LED lights to indicate various conditions n Power : indicates presence of power n DMZ: use differs; ex: can show boot progress n WLAN LED n Ethernet n Internet n You can manipulate the LED thru’ your code by changing contents of system files.
Linksys WRT 54 GL (contd. ) n Linux kernel 2. 4 n Based on Broadcom BCM 535 E So. C (System on Chip) n All-in-one Internet-sharing router, n n n 1/29/2022 4 -port switch 54 Mbps wireless-G (802. 11 g) access point Shares a single internet connection with Ethernet wired and wireless-G –B devices Push button setup High security: TKIP and AES encryption providing a powerful firewall 10
Processor Architecture n Processor: Broadcom MIPS (Microprocessor without Interlocked Pipeline Stages) processor, common to embedded devices and game consoles. n RISC (reduced instruction set computer) n MIPS is used Sony playstation for example. n We will develop programs in Linux OS: you will use Timberlake for off-campus; you can also a special server we have for the course nexos-dlink. cse. buffalo. edu n We will cross compile and load the firmware into WRT 54 GL (“port”)
BCM 5352 n Next generation So. C (System on a Chip) n So. C: combines CPU + Wireless MAC + Ethernet MAC onto one chip n Flash memory n SDRAM n Wireless access (802. 11) n Ethernet switch
WRT 54 GL Block diagram n See attached n Also follow this model: CPU Input 1/29/2022 Storage Output 13
Processor Architecture n WRT 54 Gl uses Broadcom MIPS (Microprocessor without Interlocked Pipelines Stages) processor, common to embedded devices and game consoles. n Model: BCM 5352 n Based on Reduced Instruction Set Architecture (RISC) n The BCM 5532 family of processors is a next generation So. C architecture that combines the CPU, Wireless MAC (media access controller), Ethernet MAC onto one chip 1/29/2022 14
Storage n On board storage is indeed a limitation when using WRT 54 GL in situation other than for which it is meant for. n WRT 54 GL has a flash memory (4 MB), a form of non-volatile storage commonly used in small devices, such as digital camera. n It also use SDRAM (Synchronous Dynamic Random Access Memory) soldered directly into the printed board. DIMM (Dual In-line Memory Module) 1/29/2022 15
Wireless and Ethernet networking n WRT 54 GL has a powerful networking architecture n It provides 5 port Ethernet switch that is broken down into two virtual n n n LANs VLAN 0 and VLAN 1 (default) Wireless interface is bridged by default to the Ethernet switch. Wi. Fi component is BCM 2050, a 802. 11 b/g radio chipset. It uses a diversity chip to balance signals between two built-in antenna. Wi. Fi radio connects to the CPU Wireless MAC on eth 1 which is bridged to VLAN 0 via br 0 interface. Ethernet switch controls Ethernet. LAN and Internet lights, whereas Power, DMZ, WLAN are controlled by GPIO port on the CPU WAN port: plug in cable modem into this port, n n n 1/29/2022 it will pull a DHCP (Dynamic Host Configuration Protocol) address from your ISP (Internet Service Provider). Since it belongs to VLAN 1 it is separate from VLAN 0 and the two are linked by WRT 54 Gl’s routing capabilities. Firewall prevents traffic from flowing from WAN to LAN network, traffic initiated by LAN to exit via WAN. 16
What does WRT 54 GL do? n Creates a network between the wireless interface and the LAN ports known as br 0. n Router address is 192. 168. 1. 1 by default. n WLAN port (port 4). n Typically you will plug your cable modem into this port; this will pull the DHCP address from your ISP. n WAN and LAN are separate network linked by WRT 54 GL
The Basic Hardware modifications 1/29/2022 SIGCSE 2009 NSF SHOWCASE 18
The NSF-Supported Facility at UB 1/29/2022 SIGCSE 2009 NSF SHOWCASE 19
Embedded XINU n http: //xinu. mscs. mu. edu/Main_Page n XINU ("XINU Is Not Unix", a recursive acronym) is a Unix-like operating system originally developed by Douglas Comer for instructional purposes at Purdue University in the 1980 s. n Embedded XINU is a reimplementation of the original XINU operating system on the MIPS processor which is able to run on inexpensive wireless routers and is suitable for courses and research in the areas of Operating Systems, Hardware Systems, Embedded Systems, and Compilers. 1/29/2022 20
Embedded XINU n http: //xinu. mscs. mu. edu/Memory n ls xinu_mips-1. 0 AUTHORS README include loader system tty LICENSE compile lib shell test uart n See attached XINU directory structure and class diagram 1/29/2022 21
- Slides: 21