Category Archives: Uncategorized

Syscall / System Call / vDSO in FreeBSD and Linux

vsyscall / vDSO

vDSOs (virtual dynamically linked shared objects)
What are vdso and vsyscall?
Creating a vDSO: the Colonel’s Other Chicken
On vsyscalls and the vDSO
Linux syscall, vsyscall, and vDSO… Oh My!
What is linux-gate.so.1?

Sysenter Based System Call Mechanism in Linux 2.6
How to invoke a system call via sysenter in inline assembly (x86/amd64 linux)?
Intel x86 vs x64 system call
Call gate
System Calls
Sysenter
Debugging in AMD64 64-bit Mode in Theory

Comparison of command shells

Linux

Linux kernel interfaces
The Linux Programming Interface
System call
wait (system call)
read (system call)

Linux System Calls Overview
Where is the system call table in linux kernel v3.9?
Where is the system call table in linux kernel v3.9?
Adding a System call for Linux 3.10 x86_64
ARM Kernel-provided User Helpers
Add new system call to linux kernel…
Linux Syscall Reference for Kernel 2.6
List of Linux/i386 system calls for Kernel 2.6
man syscalls – Linux system calls

FreeBSD

Adding Syscalls To FreeBSD
runtime: reconsider using SYSCALL instruction on FreeBSD
Reading the FreeBSD Kernel
int80h.org

grep -r sysenter .
grep -r sysexit .
grep -r db_inst_0f0x .
grep -r db_inst_0f .
grep -r "int 0x80" .
grep -r "syscall" .
grep -r "sys/syscall.h" .
grep -r "sy_call" .
grep -r sigtramp.S .
grep -r "NON_GPROF_ENTRY(sigcode)" .
grep -r "sigcode" .
grep -r SYS_sigreturn .
#include <sys/syscall.h>

./powerpc/booke/vm_machdep.c
./powerpc/booke/trap.c:

./i386/i386/trap.c
./i386/i386/elf_machdep.c
./i386/i386/locore.s
./i386/xen/locore.s

./arm/arm/sys_machdep.c
./arm/arm/vm_machdep.c
./arm/arm/trap.c
./arm/arm/locore.S
./arm/arm/elf_machdep.c

./amd64/amd64/trap.c
./amd64/amd64/elf_machdep.c
./amd64/ia32/ia32_signal.c
./amd64/ia32/ia32_sigtramp.S
./amd64/ia32/ia32_reg.c
./amd64/ia32/ia32_syscall.c

SYS_syscall 
 
cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa)

/*
 * System call handler for native binaries.  The trap frame is already
 * set up by the assembler trampoline and a pointer to it is saved in
 * td_frame.
 */
void
amd64_syscall(struct thread *td, int traced)
{
    [...]
}

./kern/subr_syscall.c:syscallenter(struct thread *td, struct syscall_args *sa)

static inline int
syscallenter(struct thread *td, struct syscall_args *sa)
{
        struct proc *p;
        int error, traced;

        PCPU_INC(cnt.v_syscall);
        p = td->td_proc;
        
        error = (p->p_sysent->sv_fetch_syscall_args)(td, sa);


                error = syscall_thread_enter(td, sa->callp);

                AUDIT_SYSCALL_ENTER(sa->code, td);
                error = (sa->callp->sy_call)(td, sa->args);
                AUDIT_SYSCALL_EXIT(error, td);

                syscall_thread_exit(td, sa->callp);
}

./amd64/amd64/db_trace.c:       sy_call_t *f;
./amd64/amd64/db_trace.c:               f = p->p_sysent->sv_table[number].sy_call;

ARM

The arguments of sys_sigreturn
svn commit: r245414 – head/sys/arm/arm/locore.S

==================================================

i386

Wikipedia: INT (x86 instruction)

ARM

List of ARM microarchitectures

  • ARM9E (ARMv5TEJ => ARM926EJ-S)
  • ARM10E (ARMv5TEJ => ARM1026EJ-S)
  • ARM11 (ARMv6Z => ARM1176JZ(F)-S)
  • Cortex-M (ARMv7E-M => Cortex-M4)
  • Cortex-A 32-bit (ARMv7-A => Cortex-A17)
  • Cortex-A 64-bit (ARMv8-A => Cortex-A57)

Thumb software interrupt and breakpoint instructions > Software interrupt (SWI)
Developing software for Cortex-M3 > Supervisor Calls (SVC) => formerly SWI
ARM and Thumb Instructions > Hypervisor Call (HVC) (Virtualization Extensions)
SWI : SoftWare Interrupt
Keil: SWI Functions, run in Supervisor Mode of ARM7 and ARM9, interrupt protected
Keil: SVC Functions, run in Privileged Handler Mode of the Cortex-M core
Are ARM instructuons SWI and SVC exactly same thing?
How to use the SWI in ARM Cortex A9 for enabling the IRQ interrupt?
Which Cortex-M3 interrupts can I use for general purpose work?
Effective Use of ARM Cortex-M3 SVCall

Windowing System, Desktop Environment, Window Manager

Windowing System

Windowing system
Display server

X Window System

X Window System

Remote Desktop

Desktop Environment

Desktop Environments
Comparison of X Window System desktop environments
What kinds of desktop environments and shells are available?

Window Manager

Window Manager
Comparison of X Window Managers

How to determine which window manager is running

$ sudo apt-get install wmctrl
$ man wmctrl
-m  Display information about the window manager ...
$ wmctrl -m
Name: Metacity
$ echo $DESKTOP_SESSION
ubuntu-2d
$ echo $XDG_CURRENT_DESKTOP
Unity

Compositing

Compositing Window Manager

Widget Toolkits

List of widget toolkits

TI CC3200

CC3200, for CC3200-LAUNCHXL
TI Stellaris LaunchPad EK-LM4F120XL

CC3200 SDK (Windows Only)
CC31xx & CC32xx Wiki (SimpleLink)
CC3200 SimpleLink Overview
CC3200 SimpleLink Porting
CC3200 Peripheral Driver Library User’s Guide

CC32xx LaunchPad Hardware
TI PinMux Tool
TI PinMux Tool v4 in the Cloud (YouTube Video)
CC32xx SDK Sample Applications

Documentation

Getting Started with WLAN Station -User’s Guide
Programmer’s Guide

Energia

Energia CC3200 Jumper Settings

VisualStudio

Creating a basic Wireless App for CC3200

Linux

Using the CC3200 Launchpad Under Linux
TI’s SimpleLink CC3200-LaunchXL with Linux First Steps
CC3200 development under Linux
CC3200-Linux-SDK: SDK, tools and doc about CC3200 uC development under linux

NuttX

NuttX Real-Time Operating System
SourceForge NuttX

awk

awk = Aho, Weinberger, and Kernighan

$0 = whole line
$1 = first field
$2 = second field
[...]
$NF = last field
FS = field separator, default FS=\s+
OFS = output field seperator
RS = record (line) separator
ORS = output record seperator
NR = number of records (counter from 1 to n)
NF = total number of fields
FILENAME = name of the current input file
FNR = number of records relative to the current input file
match()
  -> RSTART = where the pattern starts
  -> RLENGTH = the length of the pattern

Starters

Awk – A Tutorial and Introduction – by Bruce Barnett
Awk Introduction Tutorial – 7 Awk Print Examples
10 Awk Tips, Tricks and Pitfalls

BEGIN and END

gawk Manual – Startup and Cleanup Actions
AWK scripting: 10 BEGIN and END block examples

BEGIN { just once }
{ every record by itself }
END { just once }

Built-In Variables

8 Powerful Awk Built-in Variables – FS, OFS, RS, ORS, NR, NF, FILENAME, FNR

String Functions

gawk Manual – String-Manipulation Functions

String concatenate

awk – concatenate two string variable and assign to a third
gawk Manual – String Concatenation

$ awk '{b=$1$2; print b}' file
$ awk '{b=$1" "$2; print b}' file
$ awk '{b=$1 FS $2; print b}' file

Regex

gawk Manual – Using Dynamic Regexps
gawk Manual – Using Regular Expression Constants
Pass shell variable as a /pattern/ to awk
How to use awk variables in regular expressions?
Passing variable to awk and using that in a regular expression

Shell Variables

Can we use shell variables in awk?

Internet of Things (IoT) Protocols & Standards

  • SX1276 = 868 MHz ?!
  • SX1278 = 410/450/470 MHz ?!
sx127x

Internet of Things Protocols & Standards
IEEE 802.15.4
6LoWPAN
Yaler.net – Access devices from the Web
LORIOT | LoRaWAN Services and Software

LoRa Technology
Semtech Corporation SX1276MB1MAS, LORA BI-BAND 433/868 MBED SHIELD
Extreme Range Links: LoRa 868 / 900MHz SX1272 LoRa module for Arduino Waspmote and Raspberry Pi

LoRa Gateway

SX127X LoRa Product Family
Lora-net/lora_gateway
Lora-net/packet_forwarder
Lora-net/LoRaMac-node
mirakonta: Run lora_gateway and packet_forwarder on OpenWrt
mirakonta: MAKE your own 200€ LoRa gateway

IBM Research Lab Zurich: IBM Long-Range Signaling and Control (LRSC) – LoRa WAN in C
github: devttys0/libmpsse, Open source library for SPI/I2C control via FTDI chips

TTN ZH: From zero to LoRaWAN in a weekend

LoRa Gateways and Concentrators
iC880A – LoRaWAN Concentrator 868MHz
Webshop: iC880A-SPI – LoRaWAN Concentrator 868MHz

LoRa Nodes

Modtronix inAir9, Sydney
Modtronix SX1276Lib
Microchip RN2483, over UART

Multi-Tech

Multi-Tech git Repository
digikey: Multi-Tech Systems MTAC-LORA-868
digikey: Multi-Tech Systems MTAC-LORA-915
Multi-Tech Systems AN868-915A-10HRA

OpenLORA

IMST iC880A, Photo with USB connection
Raspberry Pi and Multitech LoRa mCard
MultiTech MultiConnect mCard in mini-PCIe slot on ALIX6 or APU from PC Engines

TheThingsNetwork

TheThingsNetwork
The Things Network Shop
Gateway Test

Wiki

TheThingsNetwork Wiki
Getting STarted with The Things Network
Software Overview
Hardware Overview – Gateways
Hardware Overview – Nodes
Installing your Multitech mLinux Conduit
Architecture
Current Network

github

TheThingsNetwork/lora_gateway
TheThingsNetwork/packet_forwarder

Forum

Gateway IMST IC880A / RBPI
TTN Gateway

Networks

LPWAN Map
Meiland TTN Map
TTN Zurich

EVK & Dev Kits

The AirBoard
The AirBoard – Quick Start

  • Low Power Network (LPN)
  • Low Power Wide Area Network (LPWAN)
  • Long Range (Rate?) Wide-area network (LoRaWAN)
  • IPv6 over Low power Wireless Personal Area Network (6LoWPAN)
  • machine-to-machine M2M
  • Smart City

The Things Network

The Things Network
The Things Network Wiki
Hardware Overview – Nodes
Microchip RN2483
IMST iM880a

Wikipedia Technology

SIGFOX

SIGFOX
Let’s start playing with sigfox technology, 20.03.2014
Using Telecom Design’s TD120x as a SIGFOX gateway with a Z1 mote
Wireless Garden sensing Prototype A and B (Intel Galileo, Spark Core and Grove)
A simple WiFi power cord switch with the OLIMEX ESP8266 evaluation board
Transceivers

  • Silicon Labs SI446x
  • Texas Instruments CC112x

SoC

  • Atmel ATA 8520
  • On Semiconductors AX-SIGFOX SoC

Modules

  • Adeunis Si 828 25mW
  • Atim ARM Nano
  • Nemeus MM002-xx-EU
  • Radiocrafts RC 1682-SIG
  • TD Next TD1208
  • Telit Le51-868S

EVK & Dev Kits

  • AXEL Elettronica Smart Everything
  • Adeunis Demonstrator
  • AirThings The AirBoard
  • Connit Live black USB
  • Embeblue
  • Radiocrafts RC 1682-SIG DK
  • SNOC RPISIGFOX
  • Snootlab Akeru
  • TD Next TD1208 EVK
  • TST Sistemas Smart expansion board
  • Telit LE51-868SEVK

RPMA

Ingenu’s RPMA Technology
Wikipedia: Random phase multiple access (RPMA)

FLEXlm

mgcld (Mentor Graphics -> ModelSim / QuestaSim):
xilinxd (Xilinx):
snpslmd (Synopsys):
alterad (Altera Quartus):
$ lmutil.exe lmstat -a
or
$ lmstat -a

lmutil - Copyright (c) 1989-2013 Flexera Software LLC. All Rights Reserved.
Flexible License Manager status on Wed 9/16/2015 16:03

License server status: 27005@srv-fpgalic.xxx.com
    License file(s) on srv-fpgalic.xxx.com: /usr/local/flexlm/altera/license.dat:

srv-fpgalic.xxx.com: license server UP (MASTER) v9.5

Vendor daemon status (on srv-fpgalic.xxx.com):

   alterad: UP v10.8
Feature usage info:
Users of quartus:  (Total of 7 licenses issued;  Total of 1 license in use)
  "quartus" v2015.08, vendor: alterad
  floating license

   alterad: UP v10.8
Feature usage info:
Users of 6AF8_00B9:  (Total of 15 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00B9:  (Total of 15 licenses issued;  Total of 0 licenses in use)
Users of 6AF8_00CB:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00CB:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF8_00D4:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF8_00EC:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00D4:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00EC:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00E8:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF8_00D5:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00D5:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF8_00A2:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00A2:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_D013:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of ip_base:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00AE:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00E6:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF8_00BD:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00BD:  (Total of 7 licenses issued;  Total of 0 licenses in use)
Users of maxplus2:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of maxplus2verilog:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of maxplus2vhdl:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of quartus_stratixiigx:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of quartus_stratixgx_2:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of quartus_nonvolatile_encryption:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of quartus:  (Total of 25 licenses issued;  Total of 1 license in use)
  "quartus" v2016.09, vendor: alterad
  floating license
Users of 6AF7_00C2:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_00D8:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_0014:  (Total of 25 licenses issued;  Total of 0 licenses in use)
Users of 6AF7_0034:  (Total of 25 licenses issued;  Total of 0 licenses in use)