WWW.DUMAIS.IO
ARTICLES
OVERLAY NETWORKS WITH MY SDN CONTROLLERSIMPLE LEARNING SWITCH WITH OPENFLOWINSTALLING KUBERNETES MANUALLYWRITING A HYPERVISOR WITH INTEL VT-X CREATING YOUR OWN LINUX CONTAINERSVIRTIO DRIVER IMPLEMENTATIONNETWORKING IN MY OSESP8266 BASED IRRIGATION CONTROLLERLED STRIP CONTROLLER USING ESP8266.OPENVSWITCH ON SLACKWARESHA256 ASSEMBLY IMPLEMENTATIONPROCESS CONTEXT ID AND THE TLBTHREAD MANAGEMENT IN MY HOBBY OSENABLING MULTI-PROCESSORS IN MY HOBBY OSNEW HOME AUTOMATION SYSTEMINSTALLING AND USING DOCKER ON SLACKWARESYSTEM ON A CHIP EMULATORUSING JSSIP AND ASTERISK TO MAKE A WEBPHONEC++ WEBSOCKET SERVERSIP ATTACK BANNINGBLOCK CACHING AND WRITEBACKBEAGLEBONE BLACK BARE METAL DEVELOPEMENTARM BARE METAL DEVELOPMENTUSING EPOLLMEMORY PAGINGIMPLEMENTING HTTP DIGEST AUTHENTICATIONSTACK FRAME AND THE RED ZONE (X86_64)AVX/SSE AND CONTEXT SWITCHINGHOW TO ANSWER A QUESTION THE SMART WAY.REALTEK 8139 NETWORK CARD DRIVERREST INTERFACE ENGINECISCO 1760 AS AN FXS GATEWAYHOME AUTOMATION SYSTEMEZFLORA IRRIGATION SYSTEMSUMP PUMP MONITORINGBUILDING A HOSTED MAILSERVER SERVICEI AM NOW HOSTING MY OWN DNS AND MAIL SERVERS ON AMAZON EC2DEPLOYING A LAYER3 SWITCH ON MY NETWORKACD SERVER WITH RESIPROCATEC++ JSON LIBRARYIMPLEMENTING YOUR OWN MUTEX WITH CMPXCHGWAKEUPCALL SERVER USING RESIPROCATEFFT ON AMD64CLONING A HARD DRIVECONFIGURING AND USING KVM-QEMUUSING COUCHDBINSTALLING COUCHDB ON SLACKWARENGW100 MY OS AND EDXS/LSENGW100 - MY OSASTERISK FILTER APPLICATIONCISCO ROUTER CONFIGURATIONAASTRA 411 XML APPLICATIONSPA941 PHONEBOOKSPEEDTOUCH 780 DOCUMENTATIONAASTRA CONTACT LIST XML APPLICATIONAVR32 OS FOR NGW100ASTERISK SOUND INJECTION APPLICATIONNGW100 - DIFFERENT PROBLEMS AND SOLUTIONSAASTRA PRIME RATE XML APPLICATIONSPEEDTOUCH 780 CONFIGURATIONUSING COUCHDB WITH PHPAVR32 ASSEMBLY TIPAP7000 AND NGW100 ARCHITECTUREAASTRA WEATHER XML APPLICATIONNGW100 - GETTING STARTEDAASTRA ALI XML APPLICATION

NGW100 MY OS AND EDXS/LSE

2012-02-25

Peripheral communication - EDXS/LSE

External Data eXchange Services

Peripherals are abstracted at a minimum by the OS. The OS abstracts the devices while applications must implement their drivers.A peripheral can send data (from the device to external environment) or receive data (from enviroment into the device). The OS is responsible for receiving data from the peripherals upon interrupt and to try send data until the device is ready. The module responsible for allowing the OS to exchange data between applications and peripherals is called the External Data eXchange Services (EDXS). The EDXS provides the following services:

  • Sending: An application may request the OS the to send the contents of a buffer out of a peripheral (serial port, ethernet, etc.) the OS will provide a function that waits until the device is ready and send the data. Therefore, sending functions are blocking.
  • Receiving: The OS gets notified by peripherals that data is available trough the use of interrupts. The OS will extract data from the peripheral and store it in a temporary buffer. The OS will provide a function that returns the available data if available or an error if no data is available. The OS will not notify applications that this data has been received, it is the responsibility of the applications to verify if data is ready. Receiving functions are synchronous and non-blocking.

The following is a list of device services provided by the EDXS:

  • SFlashSend
  • SFlashRecv
  • SDSend
  • SDRecv
  • EthRecv
  • EthSend
  • SerialRecv
  • SerialSend

Logical Services Extension

The EDXS allows an application to exchange raw data with peripherals. This is often not convenient though. For this reason, an extension to the EDXS is provided by the OS. This is called the Logical Services Extension (LSE). The LSE is always used with the EDXS (EDXS/LSE). Since it is impractical, with the EDXS, to access the dataflash or the ethernet controllers, the LSE will provide functions that allow applications to access a more generalized representation of the device. The LSE provides the following abstractions:

  • FAT32 File system.
    To access the dataflash and MMC
    • FSOpenFile
    • FSCloseFile
    • FSReadFile
    • FSWriteFile
    • FSDeleteFile
    • FSCreateFile
  • IP interface
    takes care of ARP,DHCP,DNS
    udp sockets
    tcp sockets (takes care of SYN/ACK and all ACKS)
    • IPInit: set ip/gateway/subnet
    • TCPConnect
    • TCPAccept
    • TCPRecv
    • TCPSend
    • TCPClose
    • UDPRecv
    • UDPSend

User interface

The EDXS/LSE provide functions that must execute in supervisor mode but accessible from application mode. For this, the "scall" mechanism will be used. The functions provided by EDXS/LSE will all be accessible trough supervisor calls. A user friendly API that wraps those call will be provided.