Chapter 3 Design and Implementation
3.9 Implementation Status
3.9.2 Implemented Kernel Components
Figure 4.1 SNDS100 Block Diagram2
sted drivers on SNDS100 board are shown as follow:
3.9.4 LW
r ability, we ported a small TCP/IP stack
3.9.3 Implemented Drivers
The implemented and te z UART driver z Timer driver z Ethernet driver
IP Integration
In o der to provide the Internet-access cap
2 This figure is obtained from the application note of S3C4510B [19].
called lwIP (i.e., lightweight IP) [5][7] to the Seed kernel. lwIP is an open source implementation of TCP/IP stack. Its design goal is to reduce memory usage and code size, making it suitable for use in an embedded system. lwIP defines a common interface called OS emulation layer between its code and the underlying OS kernel.
To port lwIP to Seed kernel, we only have to modify this layer. This layer requires the functionalities such as multi-tasking, memory management, timer, semaphore and message queue. These functionalities are fully supported by Seed kernel services.
Table 3.1 shows the function mapping between OS emulation layer and the Seed kernel. Each function in the OS emulation layer is mainly implemented by a single Seed kernel function with argument adjustment.
Functions in OS Emulation Layer Seed Kernel Functions
sys_thread_new Seed_Create_Task
sys_mbox_new Seed_Create_Message_Queue sys_mbox_free Seed_Delete_Message_Queue sys_mbox_post Seed_Send_Message_To_Queue sys_arch_mbox_fetch Seed_Receive_Message_From_Queue sys_sem_new Seed_Create_Semaphore
sys_ m_free se Seed_Delete_Semaphore
sys_arch_sem_wait Seed_Obtain_Semaphore
sy ses_ m_signal Seed_Release_Semaphore
Table 3.1 Function Mapping between lwIP OS Emulation Layer and Seed kernel
support lwIP. The network applications that currently run on lwIP / Seed are as Besides, we also ported on Ethernet driver to the SNDS100 board in order to
following:
z TCP Echo server z UDP Echo server z Simple HTTP server
z Shell program (i.e., a telnet server).
Chapter 4
Experimental Results
In this chapter eriment results of Seed kernel. The code size
and primitiv We measure the
network performance in Section 4.2.
4.1 Basic Measurement
4.1.1 Code Size
The code was compiled for ARM7TDMI using ARM Developer Suite 1.2 [2].
The resulting size of the compiled code is shown in Table 4.1. The Code size column shows the size of the compiled executable object code, and the Data size column shows the data size used by the object code. The total code size of Seed OS is about 16K bytes and the total data size is about 35K. The libraries are some primitive libraries for applications, such as string library, standard library (stdlib) and etc. The kernel image generated by the linker is about 21K bytes. In conclusion, Seed kernel is very small and is suitable for embedded systems whose hardware resources are scarce.
Function Code size (bytes) Data size (bytes) , we present the exp
e performance measurement are presented in Section 4.1.
HAL 2356 27388
Task Management 3164 2500
Interrupt Management 1036 257
Timer Management 1404 1256
Memory Partition 664 0
Message Queue 2004 0
Semaphore 776 0 Other kernel services 956
Libraries 4248 3441
308
Total 16608 35150
Table 4.1 Code Size of Seed Kernel
Measurement
we measure the performance of the primary functions in Seed.
Table 4.2 Performance of Seed Kernel Functions 4.1.2 Primitive Performance
In this section,
The performance result is shown in Table 4.2. Note that interrupts are disabled during the performance measurement. These results can be treated as a reference while creating applications on Seed kernel.
Function Time (μ-sec) Cycles
Task_Schduler 16.079 843
Task_Context_Switch 18.081 948
Create_Task 47.207 2475
Resume_Task 8.545 448
Suspend_Task 14.763 774
Create_Message_Queue 10.147 532
Send_Message_To_Queue 16.479 864
Receive_Message_From_Queue 16.193 849
Create_Semaphore 4.101 215
Obtain_Semaphore 4.120 216
Release_Semaphore 7.706 404
Create_Memory_Partition 18.959 994
Allocate_Memory_Block 4.005 210
Free_Memory_Block 4.520 237
Create_Timer 21.954 1151
In addition, we measure the performance of interrupt handling. Interrupt handling can be divided into three portions. The first portion is interrupt latency which as the time that a s rt run the interrupt code. In other w e of the inte sabled period p me for branching
to the exception handler. ave the CPU context of
nning task and branch to the ISR. The third portion is interrupt recovery. It is the nd the time to restore the CPU
Table 4.3 Latency of Seed Interrupt Handling
4.2 Performance Measurem the Networ ystem
, we measure the mance of lwIP on Seed kernel. At the beg sure the throughp ur system. We connect an 800 MHz Pentium
board which runs Seed kernel and lwIP 10Mbits/Sec Eth link. Besides, we use a widely-used benchmarking tool called Test TCP (TTCP measure the TCP thro TTCP to send 8M bytes of data from one device to the other.
The testing result is shown in Table 4.4. When the SNDS100 board acts as the rece is 115.93 KB/second. When it acts as the sender, the throughput can reach to 190.54 KB/second. The throughput is lower when it acts as
. The reason is lwIP needs another task responsible for receiving Ethernet is defined ystem takes to sta ning
ords, it is the tim rrupt di lus the ti The second portion is the time to s ru
time to determinate if a higher priority task is ready a
context. Table 4.3 illustrates the latency of each interrupt portion.
Function Time (μ-sec) Cycles
Interrupt Latency 34.695 1819
Time to save CPU context 20.409 1070
Interrupt Recovery 35.667 1870
ent of k S
In this section perfor
inning, we mea ut of o
III notebook (IBM Thinkpad X22) running Linux 2.4.18 to the SNDS100
with a ernet
) to ughput. We configure
iver, the throughput
the receiver
packets. This will involves more task context switches, thus there is an unavoidable performance degradation for lwIP receiving packets.
Throughput (KBytes/Sec)
lwIP Rx 115.93 KB/Sec
lwIP Tx 190.54 KB/Sec
Table 4.4 Throughput of LWIP Running on Seed
Besides the throughput, we also measure the round-trip time of lwIP running on See asurement was taken u ogram. The average round-trip time we send 1000 of 64-byte to the S100 board. The perf wn in this se e comparable with previous ones [6].
However, we do not s are different.
At last, we measure the performance of a simple web server that running on lwIP.
ion 2.5.
We c
d. This me sing the ping pr
is 0.991 ms when packets SND
ormance results sho ction ar
perform precise comparison since the platform
The performance is measured by using the WebStone [14] benchmark vers
onfigure the profile as that a client continuously requests a single homepage file in ten minutes. The testing result is shown in Table 4.5. The result shows that the performance of the small HTTP server is acceptable for small embedded devices.
Server Connection Rate 39.05 Connections/ Sec Server Throughput 147.20 KBytes/ Sec Average Response Time 25.59 ms
Table 4.5 Performance of Simple Web Server Running on lwIP
Chapter 5
Conclusion and Future Work
5.1 Conclusion
In this thesis, we describe the arch eed, a real-tome embedded kernel rnet-access cap n goal of Seed is to support
small network app ded requirements.
he kernel is flexible and high performance. In addition, it has a hardware abstraction
S
eed can reach to 190.54 KB/Sec. These results show that Seed is suitable for non-high
speed embed at requ
5.2 Futu
In the future, we want to implement Earliest Deadline First (EDF) scheduling algorithm on Seed. This is much easier to accomplish because the kernel services are deterministic or constant, and the priority can be dynamically changed at run-time.
itecture and internal of S with Inte ability. The desig
liances which may also have real-time and embed T
layer which eases the effort of porting the kernel to different hardware platforms.
These features make Seed suitable for embedded systems. Moreover, the Seed kernel services have deterministic timing behavior, so it is also suitable for the real-time applications. Finally, a small TCP/IP stack named lwIP was ported to Seed to enable the Internet-access capability.
eed is currently implemented on Samsung SNDS100 evaluation board. It provides preemptive multitasking, task synchronization/communication, and management of memory, timers and interrupts. The size of the kernel image is about 75Kbytes with lwIP, or 21Kbytes without lwIP. And the interrupt handling latency is about 90μs for a 50 MHz processor. Besides, the network throughput of lwIP/S
ded network appliance th ires real-time support.
re work
Besides, we want t
on Seed. With these systems, Seed will be more su which are equipped with storage or display. Finally
o build up embedded file systems and embedded graphic systems itable for the embedded devices , we would like to port Seed to ms to demonstrate its portability.
more hardware platfor
Reference
[1] Accelerated technology Inc., Nucleus homepage, available at http://www.
acceleratedtechnology.com/embedded/plus.php, May 2004.
[2] ARM Co. Ltd., ARM Developer Suite, available at http://www.arm.com/
products /DevTools/ADS.html, May 2004.
[3] D. P. Bovet and M. Cesati, “Understanding the Linux Kernel (2nd Edition),”
O'Reilly, Dec. 2002.
[4] L. Deller and G. Heiser, “Linking Programs in a Single Address Space,” In Proceedings of 3rd Symposium on Operating Systems Design and Implementation, USENIX, pp. 283-294, Feb. 1999.
[5] A. Dunkels, “Design and Implementation of the LWIP TCP/IP Stack,” Technical Report, Feb. 2001.
[6] A. Dunkels, “Full TCP/IP for 8-Bit Architectures,” In Proceedings of the first international conference on mobile applications, systems and services, pp. 85-98, May 2003.
[7] A. Dunkels, “lwIP – a lightweight TCP/IP stack,” available at http://www.sics.se/ ~adam/lwip/, May 2004.
[8] Finite State Machine Labs Inc., RTLinux RTOS, available at http://www.rtlinux.org/.
[9] S. B. Furber, “ARM System-on-Chip Architecture (2nd Edition),” Addison- Wesley, Aug. 2000.
[10] J. J. Labrosse, “MicroC/OS II: The Real Time Kernel,” CMP Books, June 2002.
[11] Lynuxworks Inc., LynxOS homepage, available at http://www.lynuxworks.com/
rtos/lynxos.php3, May 2004.
[12] Metrowerks Inc., “Linux Solutions”, available at http://www.metrowerks.com/
MW/Develop/Embedded/Linux/default.htm, May 2004.
[13] Microsoft Inc., Windows CE homepage, available at http://www.microsoft.com/
embedded/, May 2004.
[14] Mindcraft Inc., “Webstone: The Benchmark for Web Servers”, available at http://www.mindcraft.com/benchmarks/webstone/, May 2004.
[15] MontaVista Software Inc., “MontaVista Linux”, available at http://www.mvista.com/, May 2004.
[16] QNX Software System Inc., QNX homepage, available at http://www.qnx.com/, May 2004.
[17] Real Time Linux Foundation Inc., Real Time Linux Foundation homepage, available at http://www.realtimelinuxfoundation.org/.
[18] Redhat Inc., “eCos RTOS,” available at http://sources.redhat.com/ecos/, Apr.
2004.
[19] Samsung Electronics Co. Ltd., “Application Note for S3C4510B,” available at http://www.samsung.com/Products/Semiconductor/SystemLSI/Networks/Person alNTASSP/CommunicationProcessor/S3C4510B/an_s3c4510b.pdf, Oct. 2001.
cts/Semiconductor/0020SystemLSI/
[20] Samsung Electronics Co. Ltd., “User’s Manual Rev. 1.0 for S3C4510B,”
available at http://www.samsung.com/Produ
Networks/PersonalNTASSP/CommunicationProcessor/S3C4510B/ums3c4510b _rev1.pdf, Oct. 2001.
[22] y inheritance protocols: An
175-1185, Sep. 1990.
[21] D. Seal, “ARM Architecture Reference Manual (2nd Edition),“ Addison-Wesley, Dec. 2001.
L. Sha, R. Rajkumar, and J. P. Lehoczky, “Priorit
approach to real-time synchronization,” In IEEE Transactions on Computers, Vol. 39, No. 9, pp. 1
[23] Windriver Inc, VxWORKS homepage, available at http://www.windriver.com/
products/device_technologies/os/vxworks5/, May 2004.