SlideShare une entreprise Scribd logo
1  sur  82
Télécharger pour lire hors ligne
實作輕量級 RTOS 網路堆疊
                            Apr 24, 2009


             Jim Huang( 黃敬群 /jserv)
       Email: <jserv.tw@gmail.com>
  Blog: http://blog.linux.org.tw/jserv/
自我介紹

Phone/PDA, GPS, Mobile TV/Digital TV 代工設計
參與自由軟體開發 / 社群組織
 新酷音輸入法
                 Xenomai           Debian Taiwan
 Kaffe.org
                 Orz Microkernel   KDE Taiwan
 GNU Classpath
                 pcmanx            TOSSUG
 FreeDesktop
                 LXDE              0xlab (4/27)
 OpenMoko
                 OpenAVS
 ...
                 ...

  警告:本議程僅探討實務面,忽略理論部份
提綱
動機
Bell 定律:每十年運算型態的移轉
RTOS 與嵌入式裝置的角色
實現 TCP/IP 的難題
回歸現實:剪裁與調適
技術討論
動機

每年寫一套作業系統
當作業 ( 對不起,遲交 )
 JK (2001)
 Orz Microkernel (2006)
 RT nanokernel (2007)
 Jamei RTOS (2007)
 CuRT (2009)
 ??? (2009)
動機   (1)


Everything can
be Orz.
 Orz Microkernel
動機   (2)


Orz Microkernel
的啟發
 學習作業系統與相關的系統程
 式該如何設計
 建立自信:原來一個作業系統
 只需幾 kb 的空間就實做出來
動機   (3)


設計作業系統也
可很有趣
 以實體的機器人設計作為主軸
 體驗如何親手打造嵌入式系統
 並著手設計相關軟硬體建設
動機   (4)

從零到有,設計即時
作業系統
 杜威博士:「作中學」
 RT nanokernel (OSDC.tw 2007)
 Jamei (COSCUP 2007)
 模仿 Linux 經典設計並建構具體而微的
 RTOS
動機   (5)


滿足自動控制系
統需求
 即時處理
 建構嵌入式環境
 網路通訊能力
應用型態
國防軍事
科學搜救探索
彷生物型態
機器人足球賽
動機   (6)

簡化設計,適用更廣
範圍的硬體
 CuRT (2009)
 硬體: Marvell/Intel PXA255
 特徵
     Preemptive Multi-threading
     Priority-base Round-Robin Scheduling
     Thread Management
     Semaphore Management Support
     IPC: mailbox, message queue
Bell 定律:每十年運算
型態的移轉
1980 年代: PC revolution
1990 年代: Internet revolution
2000 年代: embedded revolution
2010 年代: embedded Internet revolution
RTOS 與嵌入式
裝置
enocean.com




Building automation
streetlinenetworks.com




Wirelss parking management
嵌入式無線網路

 Star networks




 Mesh networks
典型嵌入式硬體
        Small microcontroller (microprocessor + I/O)
●



            8- and 16-bit processors
    ●



            Typical memory size
    ●



             1 – 100 k Flash ROM for code
        ●



             0.1 – 10 k RAM for data
        ●



            Typical speed
    ●



             1 – 10 MHz
        ●



        8051, AVR, MSP430, Z80, 6502, ARM, ...
●
設計自己的 RTOS
Jamei = Just Another Microprocessor Embedded
  Infrastructure
     輕巧並可調整組態
     仿造 Linux kernel 部份設計
       arch( 平台相依實做 )
       device driver model
       vfs
     部份 POSIX Thread
     部份 Realtime API (IEEE 1003.1b)
     New BSD License 與 GNU GPLv2( 部份 )
     支援 i386 與 ARM9
RTOS 結構

• Introduction
• Structure         Applications
                                     POSIX
• RTOS Kernel                       Subsystem


• Tasks                                         Use r Mo de

• Memory                                        Ke rne l Mo de

• Timers
                                            Security
                                    Object
• I/O                               Manager Reference
                                            Monitor

                    RTOS-kernel
• IPCs
                                      HAL : Hardware Abstraction Layer
                    Driver/BSP
• Device Driver
• In an Action


                  Custom-Hardware
RTOS Kernel

• Introduction
• Structure
• RTOS Kernel
• Tasks
• Memory
• Timers
• I/O
• IPCs
• Device Driver
• In an Action
ThreadC
RealMain                                     Stack
                                             RealMain
                                             ThreadC
Scheduler                                     Timer
                                              Alarm
               Timer
                                           Task Queue

              Alarm
                                  Action
     serial
                                      Interrupt table
              H/W timer   A/D conv.
    receive
ThreadC
RealMain                                     Stack
                                              Alarm
                                              Timer
Scheduler                                    Scheduler


               Timer
                                           Task Queue
                                             timer task
              Alarm
                                  Action
     serial
                                      Interrupt table
              H/W timer   A/D conv.
    receive
ThreadC
RealMain                                     Stack
                                             Scheduler
                                              Timer
Scheduler                                    ThreadC
                                              Action
               Timer
                                           Task Queue
                                             timer task
              Alarm
                                  Action
     serial
                                      Interrupt table
              H/W timer   A/D conv.
    receive
RTOS Kernel::Tasks
    Task 是 RTOS 最重要的項目
                  RTOS scheduler 必須 determinstic
• Introduction

                    O(1) or O(n)
• Structure
                                             笨蛋,問題在
• RTOS Kernel                                scheduling !
                  Scheduling policy
• Tasks
                    Clock driven
• Memory
• Timers
                    Priority driven (RMS & EDF)
• I/O
                                     new      ready
• IPCs                                                  scheduler
                                     task
• Device Driver
• In an Action
                                                        running
                                                              terminatin
                                              waiting
                                     signal
                                                                 tasks
                                     events
RTOS Kernel::Tasks
         Task 的狀態移轉
• Introduction
• Structure
                                                       Terminate
                                   sleep
• RTOS Kernel
• Tasks
• Memory
                                Start Terminate
• Timers
                                            Get something
• I/O
                  Terminate                                   waiting
                                   ready
• IPCs
• Device Driver
                                               Wait something
• In an Action
                              Context switch

                                                  Interrupt
                                  running                               ISR
                                                  Return
RTOS Kernel::Tasks
         TCB (Task Control Block)
                                                         rt_thread_struct
• Introduction
                                   stack               SAVED_TASK_STATE
                   stack
• Structure
                                                              signals
• RTOS Kernel
• Tasks                                                       events
                   TCB             TCB
• Memory                                                 current_deadline,
                     priority        priority
                     status          status
• Timers                                                       policy
                      stack           stack
• I/O              CPU register    CPU register
                                                            context_tid
• IPCs
                                                                 .
                   The other ...   The other ...
                                                         System Variables
• Device Driver
• In an Action
                          CPU registers            context
RTOS Kernel::Tasks
    Jamei 中 thread 是 Task 的單元
                  typedef struct rt_thread_struct *pthread_t;
• Introduction
                  pthread_create
• Structure
• RTOS Kernel
                  pthread_exit
• Tasks
                  pthread_kill
• Memory

                  pthread_wakeup_np
• Timers
• I/O
                  pthread_suspend_np
• IPCs

                  pthread_wait_np
• Device Driver
• In an Action
                  ...            試圖滿足 POSIX Thread 語意
                                   ●


                                       _np]non-POSIX
                                   ●
RTOS Kernel::Tasks
    Jamei 中 thread 是 Task 的單元
                                                                    preempt
                       Task A                  Task A
• Introduction
                                 isr                        isr
• Structure
                                             Call the Scheduler
• RTOS Kernel
                       Task A                                       Task B
• Tasks
• Memory                        Task B         Task A
              non-preempt
• Timers
                                                                    preemptive      scheduling
                                   int rt_schedule(void)
• I/O
                                   {
                                     struct rt_thread_struct *preemptor = 0;
• IPCs
                                     ...
• Device Driver
                                    if ((s->clock->mode == RT_CLOCK_MODE_ONESHOT)) {
• In an Action                        if ((preemptor = find_preemptor(s,new_task)))

                                        {
                                          (s->clock)->settimer(s->clock, preemptor->resume_time - now);
                                        } else {
                                          (s->clock)->settimer(s->clock, (HRTICKS_PER_SEC / HZ) / 2 );
                                        }
優先權 Task A < Task B                     set_bit (RT_SCHED_TIMER_OK, &s->sched_flags);
                                    }
RTOS Kernel::Memory

                        在 i386 硬體架構下, Jamei 可支援
• Introduction
                        MMU (virtual memory) 與 MPU
• Structure

                        (memory protection)
• RTOS Kernel
• Tasks
                        區分 user-space 與 kernel-space
• Memory
                                    void start_kernel(void)
                        memory
• Timers                            {
                                                  /* architecture-dependent */
• I/O
                                                   init_arch();
• IPCs                                            /* NOTE:
                                                     - Mask all interrupts.
• Device Driver                                      - Interrupts are mapped in 0x20-0x30 IDT entries
                                                  */
• In an Action
                                                  #if CONFIG_KERNEL_MEMORYPROT
                       User Space memory           init_page();
                  P1                         P2
                                                  #endif

                                                  #if CONFIG_CONTEXT_MEMORYPROT
                                                   init_context();
                  M1                         M2
                                                  #endif
                       Kernel Space Memory
                                                  ...
RTOS Kernel::Memory
    Jamei 仿效 POSIX/Linux 的處理
                  APIs
• Introduction
                    kmalloc / kfree
• Structure
• RTOS Kernel
                    mmap
• Tasks
                    shm (shared memory area)
• Memory
• Timers
                  有彈性的記憶體管理機制
• I/O
                    放任 (no protected memory)
• IPCs
• Device Driver
                    最低限度記憶體保護機制
• In an Action
                       不可寫入 RT executive 記憶體
                    保護 context 執行單元記憶體
RTOS Kernel::Timer
    Timer 本質上是硬體時鐘的軟體呈現
                  型態                #define HRT_FROM_NS(x) (x)
• Introduction
                                    #define HRTICKS_PER_SEC 1000000000
                   watchdog timer
• Structure
                                    #ifndef HRT_FROM_8254
• RTOS Kernel
                   programmable     #ifndef HRT_FROM_8254
• Tasks                             #define HRT_FROM_8254(x) ((x) * 838)
                   timer            #endif
• Memory
                                    #ifndef HRT_TO_8254
• Timers
                                    #define HRT_TO_8254(x) ((x) / 838)
• I/O                               #endif
• IPCs
• Device Driver
• In an Action
RTOS Kernel::Timer
                                                                       struct rt_clock {
    萬惡 HZ                                                                   ...
                                                                            int (*sethrtime)(
                                                                                  struct rt_clock *,
                            實做 HRT (High                                          hrtime_t t);
• Introduction
                            Resolution Timer)                               int (*settimer)(
• Structure
                                                                                  struct rt_clock *,
• RTOS Kernel
                            用於 sched, sync 等
                                                                                  hrtime_t interval);
                                                                            ...
• Tasks                                                                     hrtime_t resolution;
                            系統實作                                            hrtime_t value;
• Memory
                                                                            hrtime_t delta;
• Timers                                                                    pthread_spinlock_t lock;
                                                                            struct rt_clock_arch arch;
• I/O                                                                  };
• IPCs
                  int rt_schedule(void)
• Device Driver   {
                  ...
• In an Action      if ((s->clock->mode == RT_CLOCK_MODE_ONESHOT)) {
                      if ((preemptor = find_preemptor(s,new_task)))

                        {
                          (s->clock)->settimer(s->clock, preemptor->resume_time - now);
                        } else {
                          (s->clock)->settimer(s->clock, (HRTICKS_PER_SEC / HZ) / 2 );
                        }
                  ...
RTOS Kernel::I/O
 everything is file
                  Interrupt-driven
• Introduction
                     polling / DMA
• Structure
• RTOS Kernel
                  I/O mapping
• Tasks
                     memory space 與 I/O 操作的對應
• Memory
• Timers
                  APIs
• I/O
                     open / close
• IPCs
• Device Driver
                     read / write
• In an Action
                     mmap
                     register_rtdev / unregister_rtdev
RTOS Kernel::IPC
  其實是 Inter-Task Communications
                  可配置的組態
• Introduction
                   Signals
• Structure
• RTOS Kernel
                   Semaphore
• Tasks
• Memory
• Timers
• I/O
• IPCs                            signals
• Device Driver
• In an Action




                  semaphore
RTOS Kernel::Device Driver
                                            static struct rt_file_operations
                                            rt_mem_fops = {
                                                  rt_mem_llseek,
                                                  rt_mem_read,
• Introduction                                    rt_mem_write,
                                                  NULL,
• Structure                                       rt_mem_mmap,
                      Client Drivers              rt_mem_open,
• RTOS Kernel
                                                  rt_mem_release
• Tasks                                     };
• Memory
• Timers
                     Protocol Layers
• I/O
• IPCs
• Device Driver
• In an Action
                  Host Controller Drivers



                        Hardware
In an Action

• Introduction
• Structure
• RTOS Kernel
• Tasks
• Memory
• Timers
• I/O
• IPCs
• Device Driver
• In an Action
機器人硬體機構概況
硬體:就是電腦系統中,可以讓你踢一腳的地方
控制系統

軌跡產生器                         控制             反應行為
 trajectory


                                                    決策邏輯
                          sensor
              Network


              RT task
                                              控制與軌跡生成
                        Robot Interpration



                                             低階控制系統
gdb stub
 考慮在 emulation/target 模式下,該如何喚起 gdb ?
 Remote Debugging :透過 serial 或 TCP/IP 進行遠端除錯
Show me the Robot
實現 TCP/IP 的
難題
IP Network
    UDP – best­effort datagrams
➢


    TCP – connection oriented, reliable byte­stream, 
➢


    full­duplex
                                                Application
        Flow control, congestion control, etc
    ➢


    IP – best­effort packet delivery
➢                                               UDP     TCP

        Forwarding, fragmentation
    ➢
                                                        ICMP
                                                 IP
    並未對資源消耗作優化
    相對來說,是可行的解決方案                                Network

    共通性
TCP/IP stack design
                                           Application


          lwIP – lightweight IP            UDP     TCP
  ●


           “Application driven” : larger           ICMP
      ●
                                            IP

          µIP – micro IP
  ●
                                            Network

           “Network driven” : smaller
      ●
TCP/IP stack design
                                                Application
           Application driven
                                                UDP     TCP


                                                        ICMP
                                                 IP
                                      Network
                         Stack
   Application

                                                 Network
                                      lwip

            Network driven


                                 Application
                 Stack
 Network



                                      uIP
資源有限、慾望無窮

 成本、實體空間
 Memory
   ~10 k RAM, ~100 k ROM
 Energy, power consumption
   Batteries, ~10 mW
 Bandwidth
   ~100 kbits/second
資源限制


 memory
 energy
 bandwidth
資源限制: Memory+TCP/IP

  RAM vs throughput
  基本上是兩難



                      More memory




                        Less memory
資源限制

 memory

 energy
 bandwidth
資源限制:功耗




     listening 與 receiving 一樣耗電
資源限制:功耗
    listening 與 receiving 一樣耗電,需透過軟體解決
➢

    Solution 1: don’t listen (ZigBee)
➢


       Listening nodes have a lot of energy (mains powered)
     ➢


       Problem: makes mesh networking difficult
     ➢


    Solution 2: be smart about listening and energy
➢


       Power-saving radio mechanisms
     ➢
資源限制

 memory
 energy

 bandwidth
資源限制: TCP/IP bandwidth

  ~100 kbit/second
  Messages are small
                                  Header
    802.15.4 max size 128 bytes
  TCP/IP headers are large


                                   Data
TCP/IP header is too long

   TCP/IP headers 40 bytes
   UDP/IP headers 28 bytes
   802.15.4 frame size 128 bytes
     27% – 36% overhead
   IPv6 adds 20 bytes
     42% – 52% overhead
Header compression
                     僅傳遞重要資訊


  48 bytes


     IP
                         1-4 bytes
    UDP
                     Compressed header

                           Data
    Data
回歸現實:剪裁
與調適
TCP/IP stack design
                                                Application
           Application driven
                                                UDP     TCP


                                                        ICMP
                                                 IP
                                      Network
                         Stack
   Application

                                                 Network
                                      lwip

            Network driven


                                 Application
                 Stack
 Network



                                      uIP
lwIP – Application driven
                                                              Application
          http://savannah.nongnu.org/projects/lwip/
  ●




          lwIP – lightweight IP
  ●                                                           UDP     TCP

          First release late 2000
  ●
                                                                      ICMP
                                                               IP

          40k code, 40k RAM
  ●
                                                               Network

          Application driven design
  ●


            Similar to Linux, BSD stacks
      ●



          Middle­end                 Application driven
  ●




                                                                     Network
                                                      Stack
                                 Application
µIP – smallest “full” TCP/IP stack
                                        Application

     http://www.sics.se/~adam/uip/
 ●
                                                   TCP
                                        UDP

     First release 2001
 ●
                                                    ICMP
                                         IP
     3 ­ 5k code, 100 bytes ­ 2k RAM
 ●
                                         Network
     “Full” TCP/IP (RFC compliant)
 ●



     Used in Contiki OS
 ●




                            Network driven

                                              Application
                                Stack
                      Network
 µIP 技巧


      Shared packet buffer
  ●



      Lower throughput
  ●



      Event­driven APIs
  ●
Shared packet buffer


          所有封包 (outbound + inbound ) 使用同一份
  ●


          緩衝區
           緩衝區的大小決定 throughput
      ●



                                    Outbound packet
      Incoming packet



                        Packet buffer
Shared packet buffer


      Implicit locking: single­threaded access
  ●


      1) Grab packet from network – put into buffer
      2) Process packet
           Put reply packet in the same buffer
       ●



      3) Send reply packet into network


                           Packet buffer
Lower Throughput


          µIP trades throughput for RAM
  ●


           Low RAM usage = low throughput
      ●



          小的系統通常不會有太多資料
  ●



          「具通訊的能力」會比 throughput 多寡
  ●


          來得重要
Event­driven APIs

          µIP 沒有 BSD sockets
  ●



           BSD sockets 建構於 threads 之上
      ●



           Threads 引來 overhead (RAM)
      ●



          因此,透過特製的 event­driven API
  ●



          co­routine
  ●


           Applications are called by µIP, call must return
      ●



          Protosockets – BSD socket­like API based 
  ●


          on protothreads
Protothread

int a_protothread(struct pt *pt) {
  PT_BEGIN(pt);
    /* … */
    PT_WAIT_UNTIL(pt, condition1);
    /* … */
    if(something) {
        /* … */
        PT_WAIT_UNTIL(pt, condition2);
        /* … */
    }

    PT_END(pt);
}
Hierarchical Protothreads
int a_protothread(struct pt *pt) {
  static struct pt child_pt;

    PT_BEGIN(pt);

    PT_INIT(&child_pt);
    PT_WAIT_UNTIL(pt2(&child_pt) != 0);

    PT_END(pt);
}

                      int pt2(struct pt *pt) {
                        PT_BEGIN(pt);

                          PT_WAIT_UNTIL(pt, condition);

                          PT_END(pt);
                      }
Threads vs. Events
Threads: sequential code flow   Events: unstructured code flow




          No blocking wait!
Events require one stack
 Threads require per­thread stack memory


                                                              Four event handlers, one 
      Four threads, each with its own stack
                                                         ●


                                                              stack

                                              Thread 4
  Thread 1       Thread 2       Thread 3




Stack is reused for 
every event handler
                                                             Eventhandler 1
                                                             Eventhandler 2
                                                             Eventhandler 3
                                                             Eventhandler 4
Protothreads require one stack
 Threads require per­thread stack memory


                                                             Four protothreads, one 
      Four threads, each with its own stack
                                                         ●


                                                             stack

                                              Thread 4

                                         Just like events
  Thread 1       Thread 2       Thread 3




             Events require one stack

                  Four event handlers, one 
         ●

                  stack




                                                         Protothread 1
                                                         Protothread 2
                                                         Protothread 3
                                                         Protothread 4
Event­driven APIs
void example2_app(void) {
   struct example2_state *s = 
     (struct example2_state *)uip_conn­>appstate;

   if(uip_connected()) {
      s­>state = WELCOME_SENT;
      uip_send(quot;Welcome!nquot;, 9);
      return;
                                    if(uip_rexmit()) {
   }
                                       switch(s­>state) {
                                       case WELCOME_SENT:
   if(uip_acked() && 
      s­>state == WELCOME_SENT) {         uip_send(quot;Welcome!nquot;, 9);
      s­>state = WELCOME_ACKED;          break;
                                       case WELCOME_ACKED:
   }
                                          uip_send(quot;oknquot;, 3);
                                          break;
   if(uip_newdata()) {
                                       }
      uip_send(quot;oknquot;, 3);
                                    }
   }
                                 }
Event­driven APIs

        Event­driven API 不見得適用所有程式
●



        Protosockets: sockets­like API using protothreads
●


         Extremely lightweight stackless threads
    ●



         2 bytes per­thread state, no stack
    ●



        Protothreads 允許“ blocking” ,本質是循序的
●



        overhead 遠小於真實的 thread
●
Event­driven APIs
      PT_THREAD(smtp_protothread(void))
      {
        PSOCK_BEGIN(s);

        PSOCK_READTO(s, 'n');

        if(strncmp(inputbuffer, “220”, 3) != 0) {
          PSOCK_CLOSE(s);
          PSOCK_EXIT(s);
        }

        PSOCK_SEND(s, “HELO ”, 5);
        PSOCK_SEND(s, hostname, strlen(hostname));
        PSOCK_SEND(s, “rn”, 2);

        PSOCK_READTO(s, 'n');

        if(inputbuffer[0] != '2') {
          PSOCK_CLOSE(s);
          PSOCK_EXIT(s);
        }
Proof-of-concept TCP/IP stacks


     phpstack – TCP/IP stack, webserver written in PHP
 ●

     http://www.sics.se/~adam/phpstack/
     miniweb – TCP/IP stack, webserver using 30 bytes of
 ●

     RAM
     http://www.sics.se/~adam/miniweb/
技術討論
討論
     µIP 適用於低階的環境
➢


    中階或網路需求較高者,應用 lwIP 或 BSD
➢


    socket
    Thread preemption
➢
情境: Process 正等待 Device I/O( 由中斷觸發 ) 的結束,
方可繼續執行
Waiting
                                                                            Running task
 task                                      Makes the
                                         task runnable

                                  Interrupt
                      interrupt                                Scheduler
                                   handler
                       latency
          Interrupt

                                                                scheduler
                                   handler         scheduler
                                                                 duration
                                   duration         latency



kernel latency = interrupt latency +
                 handler duration +
                 scheduler latency +
                 scheduler duration
Waiting
                                                                           Running task
    task                                  Makes the
                                        task runnable

                     interrupt   Interrupt
                                                              Scheduler
                                  handler
                      latency
             Interrupt

                                                               scheduler
                                  handler         scheduler
                                                                duration
                                  duration         latency

來源
 Interrupts disabled by kernel code: Interrupt context, managed by the CPU
                                                       handler with greater 
 spinlocks, driver code...                             priority
 Bad driver using the fast interrupt
                                                    handler
 mode (should be reserved to timer
 interrupts).                                                 processes

 Other interrupts processed before.
                                       Process context, managed by the scheduler
Waiting
                                                                              Running task
   task                                      Makes the
                                           task runnable

                                    Interrupt
                        interrupt
                                                                 Scheduler
                                     handler
                         latency
            Interrupt

                                                                  scheduler
                                    handler          scheduler
                                                                   duration
                                                      latency
                                    duration

執行 interrupt handler 的時間,在以下情況會更嚴重:
 Preemption by other interrupts.
 Interrupt handler with a softirq component
 Interrupts disabled by kernel code
 Bad driver using the fast interrupt mode
 Other interrupts processed before.
Waiting
                                                                         Running task
  task                                      Makes the
                                          task runnable

                                   Interrupt
                       interrupt
                                                            Scheduler
                                    handler
                        latency
           Interrupt

                                                             scheduler
                                                scheduler
                                    handler
                                                              duration
                                    duration
                                                 latency

用於 scheduler 的時間,原因:
 Kernel code not preemptible.
     Need to wait for returning
     from interrupts or from system calls.
 Interrupts disabled for a long time in driver code.
     Can cause a timer interrupt to be missed.
Waiting
                                                                             Running task
  task                                      Makes the
                                          task runnable

                                   Interrupt
                       interrupt
                                                                 Scheduler
                                    handler
                        latency
           Interrupt

                                                                scheduler
                                    handler         scheduler
                                    duration         latency
                                                                 duration

執行 scheduler 並切換到新的 task 所耗費的時間
 執行 scheduler 的時間為常數
 context switching time
    Restoring processor registers and stack for the new process.
    Restoring the address space of the new process
    (except for threads sharing the same address space).
結論
無所不在的嵌入式系統
 Invisible Computer
機電整合與自由軟體的機會
作中學

Contenu connexe

Tendances

Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Ontico
 
Gerenciamento de Memória(2)
Gerenciamento de Memória(2)Gerenciamento de Memória(2)
Gerenciamento de Memória(2)elliando dias
 
Troubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversTroubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversSatpal Parmar
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsBrendan Gregg
 
Slide used at ACM-SAC 2014 by Suzaki
Slide used at ACM-SAC 2014 by SuzakiSlide used at ACM-SAC 2014 by Suzaki
Slide used at ACM-SAC 2014 by SuzakiKuniyasu Suzaki
 
Analyzing OS X Systems Performance with the USE Method
Analyzing OS X Systems Performance with the USE MethodAnalyzing OS X Systems Performance with the USE Method
Analyzing OS X Systems Performance with the USE MethodBrendan Gregg
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debuggingHao-Ran Liu
 
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)Anne Nicolas
 
Resilience at exascale
Resilience at exascaleResilience at exascale
Resilience at exascaleMarc Snir
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016Kuniyasu Suzaki
 
XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64The Linux Foundation
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingAnne Nicolas
 
Uvm dcon2013
Uvm dcon2013Uvm dcon2013
Uvm dcon2013sean chen
 
SREcon 2016 Performance Checklists for SREs
SREcon 2016 Performance Checklists for SREsSREcon 2016 Performance Checklists for SREs
SREcon 2016 Performance Checklists for SREsBrendan Gregg
 
Kernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverKernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverAnne Nicolas
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
from Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu Worksfrom Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu WorksZhen Wei
 
LISA2010 visualizations
LISA2010 visualizationsLISA2010 visualizations
LISA2010 visualizationsBrendan Gregg
 

Tendances (20)

Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
 
Gerenciamento de Memória(2)
Gerenciamento de Memória(2)Gerenciamento de Memória(2)
Gerenciamento de Memória(2)
 
Troubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversTroubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device Drivers
 
Qemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System EmulationQemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System Emulation
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
 
Slide used at ACM-SAC 2014 by Suzaki
Slide used at ACM-SAC 2014 by SuzakiSlide used at ACM-SAC 2014 by Suzaki
Slide used at ACM-SAC 2014 by Suzaki
 
Analyzing OS X Systems Performance with the USE Method
Analyzing OS X Systems Performance with the USE MethodAnalyzing OS X Systems Performance with the USE Method
Analyzing OS X Systems Performance with the USE Method
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
Kernel Recipes 2016 - Understanding a Real-Time System (more than just a kernel)
 
Resilience at exascale
Resilience at exascaleResilience at exascale
Resilience at exascale
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
 
XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debugging
 
Uvm dcon2013
Uvm dcon2013Uvm dcon2013
Uvm dcon2013
 
SREcon 2016 Performance Checklists for SREs
SREcon 2016 Performance Checklists for SREsSREcon 2016 Performance Checklists for SREs
SREcon 2016 Performance Checklists for SREs
 
Kernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverKernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driver
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
from Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu Worksfrom Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu Works
 
Chapter03
Chapter03Chapter03
Chapter03
 
LISA2010 visualizations
LISA2010 visualizationsLISA2010 visualizations
LISA2010 visualizations
 

En vedette

protothread and its usage in contiki OS
protothread and its usage in contiki OSprotothread and its usage in contiki OS
protothread and its usage in contiki OSSalah Amean
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Adam Dunkels
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Adam Dunkels
 
Contiki introduction I.
Contiki introduction I.Contiki introduction I.
Contiki introduction I.Dingxin Xu
 
Introduction to Tiny OS
Introduction to Tiny OSIntroduction to Tiny OS
Introduction to Tiny OSSudharsan S
 
Contiki Operating system tutorial
Contiki Operating system tutorialContiki Operating system tutorial
Contiki Operating system tutorialSalah Amean
 

En vedette (8)

protothread and its usage in contiki OS
protothread and its usage in contiki OSprotothread and its usage in contiki OS
protothread and its usage in contiki OS
 
Implementing Lightweight Networking
Implementing Lightweight NetworkingImplementing Lightweight Networking
Implementing Lightweight Networking
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
 
Contiki Presentation
Contiki PresentationContiki Presentation
Contiki Presentation
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
 
Contiki introduction I.
Contiki introduction I.Contiki introduction I.
Contiki introduction I.
 
Introduction to Tiny OS
Introduction to Tiny OSIntroduction to Tiny OS
Introduction to Tiny OS
 
Contiki Operating system tutorial
Contiki Operating system tutorialContiki Operating system tutorial
Contiki Operating system tutorial
 

Similaire à Implementing Lightweight Networking

Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System ConceptsSanjiv Malik
 
Tips on High Performance Server Programming
Tips on High Performance Server ProgrammingTips on High Performance Server Programming
Tips on High Performance Server ProgrammingJoshua Zhu
 
Advanced Oracle Troubleshooting
Advanced Oracle TroubleshootingAdvanced Oracle Troubleshooting
Advanced Oracle TroubleshootingHector Martinez
 
Lightweight Grids With Terracotta
Lightweight Grids With TerracottaLightweight Grids With Terracotta
Lightweight Grids With TerracottaPT.JUG
 
Evergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen ILS
 
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)Nate Lawson
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performancepradeepfn
 
Me3D: A Model-driven Methodology Expediting Embedded Device Driver Development
Me3D: A Model-driven Methodology  Expediting Embedded Device  Driver DevelopmentMe3D: A Model-driven Methodology  Expediting Embedded Device  Driver Development
Me3D: A Model-driven Methodology Expediting Embedded Device Driver Developmenthuichenphd
 
Memory Management for High-Performance Applications
Memory Management for High-Performance ApplicationsMemory Management for High-Performance Applications
Memory Management for High-Performance ApplicationsEmery Berger
 
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...Yuji Kubota
 
How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?Enkitec
 
Dynamic Load-balancing On Graphics Processors
Dynamic Load-balancing On Graphics ProcessorsDynamic Load-balancing On Graphics Processors
Dynamic Load-balancing On Graphics Processorsdaced
 
AHMED JASSAT SOUTH ARICAN ORACLE USER GROUP PRESENTATION
AHMED JASSAT SOUTH ARICAN ORACLE USER GROUP PRESENTATIONAHMED JASSAT SOUTH ARICAN ORACLE USER GROUP PRESENTATION
AHMED JASSAT SOUTH ARICAN ORACLE USER GROUP PRESENTATIONZahid02
 
Experiences with Debugging Data Races
Experiences with Debugging Data RacesExperiences with Debugging Data Races
Experiences with Debugging Data RacesAzul Systems Inc.
 
Introduction to windows kernel
Introduction to windows kernelIntroduction to windows kernel
Introduction to windows kernelSisimon Soman
 
Introduction to windows kernel
Introduction to windows kernelIntroduction to windows kernel
Introduction to windows kernelSisimon Soman
 

Similaire à Implementing Lightweight Networking (20)

Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System Concepts
 
Tips on High Performance Server Programming
Tips on High Performance Server ProgrammingTips on High Performance Server Programming
Tips on High Performance Server Programming
 
YARN Under The Hood
YARN Under The HoodYARN Under The Hood
YARN Under The Hood
 
Advanced Oracle Troubleshooting
Advanced Oracle TroubleshootingAdvanced Oracle Troubleshooting
Advanced Oracle Troubleshooting
 
Lightweight Grids With Terracotta
Lightweight Grids With TerracottaLightweight Grids With Terracotta
Lightweight Grids With Terracotta
 
Evergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival Skills
 
2. operating systems
2. operating systems2. operating systems
2. operating systems
 
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
 
Me3D: A Model-driven Methodology Expediting Embedded Device Driver Development
Me3D: A Model-driven Methodology  Expediting Embedded Device  Driver DevelopmentMe3D: A Model-driven Methodology  Expediting Embedded Device  Driver Development
Me3D: A Model-driven Methodology Expediting Embedded Device Driver Development
 
Tremashark
TremasharkTremashark
Tremashark
 
Memory Management for High-Performance Applications
Memory Management for High-Performance ApplicationsMemory Management for High-Performance Applications
Memory Management for High-Performance Applications
 
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
 
How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?How Many Ways Can I Manage Oracle GoldenGate?
How Many Ways Can I Manage Oracle GoldenGate?
 
No Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time JavaNo Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time Java
 
Dynamic Load-balancing On Graphics Processors
Dynamic Load-balancing On Graphics ProcessorsDynamic Load-balancing On Graphics Processors
Dynamic Load-balancing On Graphics Processors
 
AHMED JASSAT SOUTH ARICAN ORACLE USER GROUP PRESENTATION
AHMED JASSAT SOUTH ARICAN ORACLE USER GROUP PRESENTATIONAHMED JASSAT SOUTH ARICAN ORACLE USER GROUP PRESENTATION
AHMED JASSAT SOUTH ARICAN ORACLE USER GROUP PRESENTATION
 
Experiences with Debugging Data Races
Experiences with Debugging Data RacesExperiences with Debugging Data Races
Experiences with Debugging Data Races
 
Introduction to windows kernel
Introduction to windows kernelIntroduction to windows kernel
Introduction to windows kernel
 
Introduction to windows kernel
Introduction to windows kernelIntroduction to windows kernel
Introduction to windows kernel
 

Dernier

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Dernier (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Implementing Lightweight Networking

  • 1. 實作輕量級 RTOS 網路堆疊 Apr 24, 2009 Jim Huang( 黃敬群 /jserv) Email: <jserv.tw@gmail.com> Blog: http://blog.linux.org.tw/jserv/
  • 2. 自我介紹 Phone/PDA, GPS, Mobile TV/Digital TV 代工設計 參與自由軟體開發 / 社群組織 新酷音輸入法 Xenomai Debian Taiwan Kaffe.org Orz Microkernel KDE Taiwan GNU Classpath pcmanx TOSSUG FreeDesktop LXDE 0xlab (4/27) OpenMoko OpenAVS ... ... 警告:本議程僅探討實務面,忽略理論部份
  • 4. 動機 每年寫一套作業系統 當作業 ( 對不起,遲交 ) JK (2001) Orz Microkernel (2006) RT nanokernel (2007) Jamei RTOS (2007) CuRT (2009) ??? (2009)
  • 5. 動機 (1) Everything can be Orz. Orz Microkernel
  • 6. 動機 (2) Orz Microkernel 的啟發 學習作業系統與相關的系統程 式該如何設計 建立自信:原來一個作業系統 只需幾 kb 的空間就實做出來
  • 7. 動機 (3) 設計作業系統也 可很有趣 以實體的機器人設計作為主軸 體驗如何親手打造嵌入式系統 並著手設計相關軟硬體建設
  • 8. 動機 (4) 從零到有,設計即時 作業系統 杜威博士:「作中學」 RT nanokernel (OSDC.tw 2007) Jamei (COSCUP 2007) 模仿 Linux 經典設計並建構具體而微的 RTOS
  • 9. 動機 (5) 滿足自動控制系 統需求 即時處理 建構嵌入式環境 網路通訊能力
  • 11. 動機 (6) 簡化設計,適用更廣 範圍的硬體 CuRT (2009) 硬體: Marvell/Intel PXA255 特徵 Preemptive Multi-threading Priority-base Round-Robin Scheduling Thread Management Semaphore Management Support IPC: mailbox, message queue
  • 12. Bell 定律:每十年運算 型態的移轉 1980 年代: PC revolution 1990 年代: Internet revolution 2000 年代: embedded revolution 2010 年代: embedded Internet revolution
  • 17. 典型嵌入式硬體 Small microcontroller (microprocessor + I/O) ● 8- and 16-bit processors ● Typical memory size ● 1 – 100 k Flash ROM for code ● 0.1 – 10 k RAM for data ● Typical speed ● 1 – 10 MHz ● 8051, AVR, MSP430, Z80, 6502, ARM, ... ●
  • 18. 設計自己的 RTOS Jamei = Just Another Microprocessor Embedded Infrastructure 輕巧並可調整組態 仿造 Linux kernel 部份設計 arch( 平台相依實做 ) device driver model vfs 部份 POSIX Thread 部份 Realtime API (IEEE 1003.1b) New BSD License 與 GNU GPLv2( 部份 ) 支援 i386 與 ARM9
  • 19. RTOS 結構 • Introduction • Structure Applications POSIX • RTOS Kernel Subsystem • Tasks Use r Mo de • Memory Ke rne l Mo de • Timers Security Object • I/O Manager Reference Monitor RTOS-kernel • IPCs HAL : Hardware Abstraction Layer Driver/BSP • Device Driver • In an Action Custom-Hardware
  • 20. RTOS Kernel • Introduction • Structure • RTOS Kernel • Tasks • Memory • Timers • I/O • IPCs • Device Driver • In an Action
  • 21. ThreadC RealMain Stack RealMain ThreadC Scheduler Timer Alarm Timer Task Queue Alarm Action serial Interrupt table H/W timer A/D conv. receive
  • 22. ThreadC RealMain Stack Alarm Timer Scheduler Scheduler Timer Task Queue timer task Alarm Action serial Interrupt table H/W timer A/D conv. receive
  • 23. ThreadC RealMain Stack Scheduler Timer Scheduler ThreadC Action Timer Task Queue timer task Alarm Action serial Interrupt table H/W timer A/D conv. receive
  • 24. RTOS Kernel::Tasks Task 是 RTOS 最重要的項目 RTOS scheduler 必須 determinstic • Introduction O(1) or O(n) • Structure 笨蛋,問題在 • RTOS Kernel scheduling ! Scheduling policy • Tasks Clock driven • Memory • Timers Priority driven (RMS & EDF) • I/O new ready • IPCs scheduler task • Device Driver • In an Action running terminatin waiting signal tasks events
  • 25. RTOS Kernel::Tasks Task 的狀態移轉 • Introduction • Structure Terminate sleep • RTOS Kernel • Tasks • Memory Start Terminate • Timers Get something • I/O Terminate waiting ready • IPCs • Device Driver Wait something • In an Action Context switch Interrupt running ISR Return
  • 26. RTOS Kernel::Tasks TCB (Task Control Block) rt_thread_struct • Introduction stack SAVED_TASK_STATE stack • Structure signals • RTOS Kernel • Tasks events TCB TCB • Memory current_deadline, priority priority status status • Timers policy stack stack • I/O CPU register CPU register context_tid • IPCs . The other ... The other ... System Variables • Device Driver • In an Action CPU registers context
  • 27. RTOS Kernel::Tasks Jamei 中 thread 是 Task 的單元 typedef struct rt_thread_struct *pthread_t; • Introduction pthread_create • Structure • RTOS Kernel pthread_exit • Tasks pthread_kill • Memory pthread_wakeup_np • Timers • I/O pthread_suspend_np • IPCs pthread_wait_np • Device Driver • In an Action ... 試圖滿足 POSIX Thread 語意 ● _np]non-POSIX ●
  • 28. RTOS Kernel::Tasks Jamei 中 thread 是 Task 的單元 preempt Task A Task A • Introduction isr isr • Structure Call the Scheduler • RTOS Kernel Task A Task B • Tasks • Memory Task B Task A non-preempt • Timers preemptive scheduling int rt_schedule(void) • I/O { struct rt_thread_struct *preemptor = 0; • IPCs ... • Device Driver if ((s->clock->mode == RT_CLOCK_MODE_ONESHOT)) { • In an Action if ((preemptor = find_preemptor(s,new_task))) { (s->clock)->settimer(s->clock, preemptor->resume_time - now); } else { (s->clock)->settimer(s->clock, (HRTICKS_PER_SEC / HZ) / 2 ); } 優先權 Task A < Task B set_bit (RT_SCHED_TIMER_OK, &s->sched_flags); }
  • 29. RTOS Kernel::Memory 在 i386 硬體架構下, Jamei 可支援 • Introduction MMU (virtual memory) 與 MPU • Structure (memory protection) • RTOS Kernel • Tasks 區分 user-space 與 kernel-space • Memory void start_kernel(void) memory • Timers { /* architecture-dependent */ • I/O init_arch(); • IPCs /* NOTE: - Mask all interrupts. • Device Driver - Interrupts are mapped in 0x20-0x30 IDT entries */ • In an Action #if CONFIG_KERNEL_MEMORYPROT User Space memory init_page(); P1 P2 #endif #if CONFIG_CONTEXT_MEMORYPROT init_context(); M1 M2 #endif Kernel Space Memory ...
  • 30. RTOS Kernel::Memory Jamei 仿效 POSIX/Linux 的處理 APIs • Introduction kmalloc / kfree • Structure • RTOS Kernel mmap • Tasks shm (shared memory area) • Memory • Timers 有彈性的記憶體管理機制 • I/O 放任 (no protected memory) • IPCs • Device Driver 最低限度記憶體保護機制 • In an Action 不可寫入 RT executive 記憶體 保護 context 執行單元記憶體
  • 31. RTOS Kernel::Timer Timer 本質上是硬體時鐘的軟體呈現 型態 #define HRT_FROM_NS(x) (x) • Introduction #define HRTICKS_PER_SEC 1000000000 watchdog timer • Structure #ifndef HRT_FROM_8254 • RTOS Kernel programmable #ifndef HRT_FROM_8254 • Tasks #define HRT_FROM_8254(x) ((x) * 838) timer #endif • Memory #ifndef HRT_TO_8254 • Timers #define HRT_TO_8254(x) ((x) / 838) • I/O #endif • IPCs • Device Driver • In an Action
  • 32. RTOS Kernel::Timer struct rt_clock { 萬惡 HZ ... int (*sethrtime)( struct rt_clock *, 實做 HRT (High hrtime_t t); • Introduction Resolution Timer) int (*settimer)( • Structure struct rt_clock *, • RTOS Kernel 用於 sched, sync 等 hrtime_t interval); ... • Tasks hrtime_t resolution; 系統實作 hrtime_t value; • Memory hrtime_t delta; • Timers pthread_spinlock_t lock; struct rt_clock_arch arch; • I/O }; • IPCs int rt_schedule(void) • Device Driver { ... • In an Action if ((s->clock->mode == RT_CLOCK_MODE_ONESHOT)) { if ((preemptor = find_preemptor(s,new_task))) { (s->clock)->settimer(s->clock, preemptor->resume_time - now); } else { (s->clock)->settimer(s->clock, (HRTICKS_PER_SEC / HZ) / 2 ); } ...
  • 33. RTOS Kernel::I/O everything is file Interrupt-driven • Introduction polling / DMA • Structure • RTOS Kernel I/O mapping • Tasks memory space 與 I/O 操作的對應 • Memory • Timers APIs • I/O open / close • IPCs • Device Driver read / write • In an Action mmap register_rtdev / unregister_rtdev
  • 34. RTOS Kernel::IPC 其實是 Inter-Task Communications 可配置的組態 • Introduction Signals • Structure • RTOS Kernel Semaphore • Tasks • Memory • Timers • I/O • IPCs signals • Device Driver • In an Action semaphore
  • 35. RTOS Kernel::Device Driver static struct rt_file_operations rt_mem_fops = { rt_mem_llseek, rt_mem_read, • Introduction rt_mem_write, NULL, • Structure rt_mem_mmap, Client Drivers rt_mem_open, • RTOS Kernel rt_mem_release • Tasks }; • Memory • Timers Protocol Layers • I/O • IPCs • Device Driver • In an Action Host Controller Drivers Hardware
  • 36. In an Action • Introduction • Structure • RTOS Kernel • Tasks • Memory • Timers • I/O • IPCs • Device Driver • In an Action
  • 38. 控制系統 軌跡產生器 控制 反應行為 trajectory 決策邏輯 sensor Network RT task 控制與軌跡生成 Robot Interpration 低階控制系統
  • 39. gdb stub 考慮在 emulation/target 模式下,該如何喚起 gdb ? Remote Debugging :透過 serial 或 TCP/IP 進行遠端除錯
  • 40. Show me the Robot
  • 41.
  • 42.
  • 44. IP Network UDP – best­effort datagrams ➢ TCP – connection oriented, reliable byte­stream,  ➢ full­duplex Application Flow control, congestion control, etc ➢ IP – best­effort packet delivery ➢ UDP TCP Forwarding, fragmentation ➢ ICMP IP 並未對資源消耗作優化 相對來說,是可行的解決方案 Network 共通性
  • 45. TCP/IP stack design Application lwIP – lightweight IP UDP TCP ● “Application driven” : larger ICMP ● IP µIP – micro IP ● Network “Network driven” : smaller ●
  • 46. TCP/IP stack design Application Application driven UDP TCP ICMP IP Network Stack Application Network lwip Network driven Application Stack Network uIP
  • 47. 資源有限、慾望無窮 成本、實體空間 Memory ~10 k RAM, ~100 k ROM Energy, power consumption Batteries, ~10 mW Bandwidth ~100 kbits/second
  • 49. 資源限制: Memory+TCP/IP RAM vs throughput 基本上是兩難 More memory Less memory
  • 51. 資源限制:功耗 listening 與 receiving 一樣耗電
  • 52. 資源限制:功耗 listening 與 receiving 一樣耗電,需透過軟體解決 ➢ Solution 1: don’t listen (ZigBee) ➢ Listening nodes have a lot of energy (mains powered) ➢ Problem: makes mesh networking difficult ➢ Solution 2: be smart about listening and energy ➢ Power-saving radio mechanisms ➢
  • 54. 資源限制: TCP/IP bandwidth ~100 kbit/second Messages are small Header 802.15.4 max size 128 bytes TCP/IP headers are large Data
  • 55. TCP/IP header is too long TCP/IP headers 40 bytes UDP/IP headers 28 bytes 802.15.4 frame size 128 bytes 27% – 36% overhead IPv6 adds 20 bytes 42% – 52% overhead
  • 56. Header compression 僅傳遞重要資訊 48 bytes IP 1-4 bytes UDP Compressed header Data Data
  • 58. TCP/IP stack design Application Application driven UDP TCP ICMP IP Network Stack Application Network lwip Network driven Application Stack Network uIP
  • 59. lwIP – Application driven Application http://savannah.nongnu.org/projects/lwip/ ● lwIP – lightweight IP ● UDP TCP First release late 2000 ● ICMP IP 40k code, 40k RAM ● Network Application driven design ● Similar to Linux, BSD stacks ● Middle­end Application driven ● Network Stack Application
  • 60. µIP – smallest “full” TCP/IP stack Application http://www.sics.se/~adam/uip/ ● TCP UDP First release 2001 ● ICMP IP 3 ­ 5k code, 100 bytes ­ 2k RAM ● Network “Full” TCP/IP (RFC compliant) ● Used in Contiki OS ● Network driven Application Stack Network
  • 61.  µIP 技巧 Shared packet buffer ● Lower throughput ● Event­driven APIs ●
  • 62. Shared packet buffer 所有封包 (outbound + inbound ) 使用同一份 ● 緩衝區 緩衝區的大小決定 throughput ● Outbound packet Incoming packet Packet buffer
  • 63. Shared packet buffer Implicit locking: single­threaded access ● 1) Grab packet from network – put into buffer 2) Process packet Put reply packet in the same buffer ● 3) Send reply packet into network Packet buffer
  • 64. Lower Throughput µIP trades throughput for RAM ● Low RAM usage = low throughput ● 小的系統通常不會有太多資料 ● 「具通訊的能力」會比 throughput 多寡 ● 來得重要
  • 65. Event­driven APIs µIP 沒有 BSD sockets ● BSD sockets 建構於 threads 之上 ● Threads 引來 overhead (RAM) ● 因此,透過特製的 event­driven API ● co­routine ● Applications are called by µIP, call must return ● Protosockets – BSD socket­like API based  ● on protothreads
  • 66. Protothread int a_protothread(struct pt *pt) { PT_BEGIN(pt); /* … */ PT_WAIT_UNTIL(pt, condition1); /* … */ if(something) { /* … */ PT_WAIT_UNTIL(pt, condition2); /* … */ } PT_END(pt); }
  • 67. Hierarchical Protothreads int a_protothread(struct pt *pt) { static struct pt child_pt; PT_BEGIN(pt); PT_INIT(&child_pt); PT_WAIT_UNTIL(pt2(&child_pt) != 0); PT_END(pt); } int pt2(struct pt *pt) { PT_BEGIN(pt); PT_WAIT_UNTIL(pt, condition); PT_END(pt); }
  • 68. Threads vs. Events Threads: sequential code flow Events: unstructured code flow No blocking wait!
  • 69. Events require one stack Threads require per­thread stack memory Four event handlers, one  Four threads, each with its own stack ● stack Thread 4 Thread 1 Thread 2 Thread 3 Stack is reused for  every event handler Eventhandler 1 Eventhandler 2 Eventhandler 3 Eventhandler 4
  • 70. Protothreads require one stack Threads require per­thread stack memory Four protothreads, one  Four threads, each with its own stack ● stack Thread 4 Just like events Thread 1 Thread 2 Thread 3 Events require one stack Four event handlers, one  ● stack Protothread 1 Protothread 2 Protothread 3 Protothread 4
  • 71. Event­driven APIs void example2_app(void) {    struct example2_state *s =       (struct example2_state *)uip_conn­>appstate;    if(uip_connected()) {       s­>state = WELCOME_SENT;       uip_send(quot;Welcome!nquot;, 9);       return;    if(uip_rexmit()) {    }       switch(s­>state) {       case WELCOME_SENT:    if(uip_acked() &&        s­>state == WELCOME_SENT) {         uip_send(quot;Welcome!nquot;, 9);       s­>state = WELCOME_ACKED;          break;       case WELCOME_ACKED:    }          uip_send(quot;oknquot;, 3);          break;    if(uip_newdata()) {       }       uip_send(quot;oknquot;, 3);    }    } }
  • 72. Event­driven APIs Event­driven API 不見得適用所有程式 ● Protosockets: sockets­like API using protothreads ● Extremely lightweight stackless threads ● 2 bytes per­thread state, no stack ● Protothreads 允許“ blocking” ,本質是循序的 ● overhead 遠小於真實的 thread ●
  • 73. Event­driven APIs PT_THREAD(smtp_protothread(void)) {   PSOCK_BEGIN(s);   PSOCK_READTO(s, 'n');   if(strncmp(inputbuffer, “220”, 3) != 0) {     PSOCK_CLOSE(s);     PSOCK_EXIT(s);   }   PSOCK_SEND(s, “HELO ”, 5);   PSOCK_SEND(s, hostname, strlen(hostname));   PSOCK_SEND(s, “rn”, 2);   PSOCK_READTO(s, 'n');   if(inputbuffer[0] != '2') {     PSOCK_CLOSE(s);     PSOCK_EXIT(s);   }
  • 74. Proof-of-concept TCP/IP stacks phpstack – TCP/IP stack, webserver written in PHP ● http://www.sics.se/~adam/phpstack/ miniweb – TCP/IP stack, webserver using 30 bytes of ● RAM http://www.sics.se/~adam/miniweb/
  • 76. 討論  µIP 適用於低階的環境 ➢ 中階或網路需求較高者,應用 lwIP 或 BSD ➢ socket Thread preemption ➢
  • 77. 情境: Process 正等待 Device I/O( 由中斷觸發 ) 的結束, 方可繼續執行 Waiting Running task task Makes the task runnable Interrupt interrupt Scheduler handler latency Interrupt scheduler handler scheduler duration duration latency kernel latency = interrupt latency + handler duration + scheduler latency + scheduler duration
  • 78. Waiting Running task task Makes the task runnable interrupt Interrupt Scheduler handler latency Interrupt scheduler handler scheduler duration duration latency 來源 Interrupts disabled by kernel code: Interrupt context, managed by the CPU handler with greater  spinlocks, driver code... priority Bad driver using the fast interrupt handler mode (should be reserved to timer interrupts). processes Other interrupts processed before. Process context, managed by the scheduler
  • 79. Waiting Running task task Makes the task runnable Interrupt interrupt Scheduler handler latency Interrupt scheduler handler scheduler duration latency duration 執行 interrupt handler 的時間,在以下情況會更嚴重: Preemption by other interrupts. Interrupt handler with a softirq component Interrupts disabled by kernel code Bad driver using the fast interrupt mode Other interrupts processed before.
  • 80. Waiting Running task task Makes the task runnable Interrupt interrupt Scheduler handler latency Interrupt scheduler scheduler handler duration duration latency 用於 scheduler 的時間,原因: Kernel code not preemptible. Need to wait for returning from interrupts or from system calls. Interrupts disabled for a long time in driver code. Can cause a timer interrupt to be missed.
  • 81. Waiting Running task task Makes the task runnable Interrupt interrupt Scheduler handler latency Interrupt scheduler handler scheduler duration latency duration 執行 scheduler 並切換到新的 task 所耗費的時間 執行 scheduler 的時間為常數 context switching time Restoring processor registers and stack for the new process. Restoring the address space of the new process (except for threads sharing the same address space).