Microcontrollers have adopted many general-purpose computing paradigms over the past decade. Filesystems, POSIX threading, and hardware abstraction layers are now common in embedded operating systems, but network connectivity remains fragmented. Existing solutions either rely on proprietary TCP/IP APIs that tie application code to a specific stack, or expose a BSD socket interface that is not integrated with the OS file descriptor table and is becoming a problem now that the kernel/user-space boundary is being introduced in microcontroller operating systems. This thesis integrates the lwIP TCP/IP stack and a BSD socket API into Miosix. The fluid kernel architecture of Miosix allows the same application code to run either as threads in the same address space of the kernel or as a user-space process confined by the hardware MPU, without source-level modification. The integration extends this property to networking. The work spans four layers. An Ethernet MAC and DMA driver for the STM32F2 microcontroller moves frames from an Ethernet interface to and from memory without CPU intervention. A sys-arch port maps the lwIP operating-system interface onto Miosix kernel primitives, so lwIP's internal threads are ordinary Miosix threads subject to the same scheduling rules as the rest of the system. lwIP sockets are integrated in the Miosix file descriptor table, making them reachable through the same POSIX calls used for files, devices, and pipes. The syscall layer was extended to expose this interface to user-space processes. Measurements on an STM32F207ZG target with a basic HTTP server show that the complete port adds approximately 86 KB to the flash image and 12.9 KB to the kernel heap's allocation. When the application runs as a user-space process, socket operations are correctly performed through syscalls.
I microcontrollori hanno adottato molti paradigmi del "general-purpose computing" nell'ultimo decennio. Filesystem, threading POSIX e livelli di astrazione hardware sono ormai comuni nei sistemi operativi embedded, ma la connettività di rete è rimasta frammentata. Le soluzioni esistenti si affidano ad API TCP/IP proprietarie che legano il codice applicativo a uno stack specifico, oppure espongono un'interfaccia socket BSD non integrata con la tabella dei file descriptor del sistema operativo, un problema che si aggrava ora che il confine kernel/user space viene introdotto nei sistemi operativi per microcontrollori. Questa tesi integra lo stack TCP/IP lwIP e un'API socket BSD in Miosix. L'architettura fluid kernel di Miosix consente allo stesso codice applicativo di essere eseguito sia come thread nello stesso spazio di indirizzamento del kernel sia come processo in user space, confinato dall'MPU hardware, senza modifiche al codice sorgente. L'integrazione estende questa proprietà alla gestione della rete. Il lavoro copre quattro livelli. Un driver Ethernet MAC e DMA per il microcontrollore STM32F2 sposta i frame tra un'interfaccia Ethernet e la memoria senza l'intervento della CPU. Un port sys-arch mappa l'interfaccia OS di lwIP alle primitive del kernel Miosix, in modo che i thread interni di lwIP siano thread Miosix ordinari soggetti alle stesse regole di scheduling del resto del sistema. I socket lwIP sono integrati nella tabella dei file descriptor di Miosix, rendendoli raggiungibili tramite le stesse chiamate POSIX usate per file, dispositivi e pipe. Il livello di syscall è stato esteso per esporre questa interfaccia ai processi in user space. Le misurazioni su un target STM32F207ZG con un server HTTP basilare mostrano che il port completo aggiunge circa 86 KB all'immagine flash e 12,9 KB all'allocazione dell'heap del kernel. Quando l'applicazione viene eseguita come processo in user space, le operazioni sui socket vengono eseguite correttamente tramite syscall.
Integrating TCP/IP capabilities in fluid kernels
BETTO, NICCOLO
2025/2026
Abstract
Microcontrollers have adopted many general-purpose computing paradigms over the past decade. Filesystems, POSIX threading, and hardware abstraction layers are now common in embedded operating systems, but network connectivity remains fragmented. Existing solutions either rely on proprietary TCP/IP APIs that tie application code to a specific stack, or expose a BSD socket interface that is not integrated with the OS file descriptor table and is becoming a problem now that the kernel/user-space boundary is being introduced in microcontroller operating systems. This thesis integrates the lwIP TCP/IP stack and a BSD socket API into Miosix. The fluid kernel architecture of Miosix allows the same application code to run either as threads in the same address space of the kernel or as a user-space process confined by the hardware MPU, without source-level modification. The integration extends this property to networking. The work spans four layers. An Ethernet MAC and DMA driver for the STM32F2 microcontroller moves frames from an Ethernet interface to and from memory without CPU intervention. A sys-arch port maps the lwIP operating-system interface onto Miosix kernel primitives, so lwIP's internal threads are ordinary Miosix threads subject to the same scheduling rules as the rest of the system. lwIP sockets are integrated in the Miosix file descriptor table, making them reachable through the same POSIX calls used for files, devices, and pipes. The syscall layer was extended to expose this interface to user-space processes. Measurements on an STM32F207ZG target with a basic HTTP server show that the complete port adds approximately 86 KB to the flash image and 12.9 KB to the kernel heap's allocation. When the application runs as a user-space process, socket operations are correctly performed through syscalls.| File | Dimensione | Formato | |
|---|---|---|---|
|
2026_07_Betto_Thesis.pdf
accessibile in internet per tutti
Dimensione
1.04 MB
Formato
Adobe PDF
|
1.04 MB | Adobe PDF | Visualizza/Apri |
|
2026_07_Betto_Executive_Summary.pdf
accessibile in internet per tutti
Dimensione
238.26 kB
Formato
Adobe PDF
|
238.26 kB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/261372