The document discusses code for serial port (com) device drivers in FreeBSD. It shows code from the comstart() function, which is called by the tty layer when there is outgoing data to transmit. Comstart() grabs the data from the tty queue and sets up the com_softc structure to start transmission. It then calls the chip-specific transmit function. The com_softc structure contains a pointer to the associated tty structure.
The document discusses the Dtrace tool for debugging, profiling, and monitoring systems. It provides an overview of Dtrace's key components like the D language, probes, consumers, and providers. Examples are given for using Dtrace for debugging issues by tracing function calls, gathering statistics on memory allocation, and visualizing process flow.
This document summarizes the history and future of PHP. It discusses the creators of PHP (Rasmus Lerdorf, Zeev Suraski, John Morris) and outlines the major versions released from PHP 1.0 in 1995 to the upcoming PHP 8.0, which will include features like FFI, JIT compilation, and asynchronous programming. It also previews potential features for future PHP versions such as OpCache core improvements and extending the instanceof operator.
The document discusses ActionScript and the ActionScript Virtual Machine 2 (AVM2). It provides examples of ActionScript bytecode (ABC) and instructions. It compares AVM1 and AVM2, and explains how AVM2 improved performance through just-in-time compilation and garbage collection. Code examples demonstrate how to compile and disassemble ABC files using tools like Flex SDK and Tamarin.
How to write rust instead of c and get away with itFlavien Raynaud
Ever tried optimizing a slow Python application and thought: “Oh! I wish I could just write this bit it in Rust”? Well, turns out you can! Let’s discuss why Rust is a better choice than C, how to use Rust to make your apps lightning fast and how to get away with it; without your users even noticing.
As Infrastructure Engineers at Yelp, the challenge we face everyday is: scale. Yelp is mostly a Python shop, so our work often revolves around making Python applications run faster. Until now, we have been using different techniques: faster interpreters, or, more often, C code.
Given its safety guarantees, performance and promise of better tooling than C, we decided we had to give Rust a try. The initial results helped reinforce that there was a lot of opportunity for Rust to play an important role in our production code.
Yelp heavily relies on the Apache Avro serialization format for its internal infrastructure. During the talk, we will show how we implemented avro-rs, an Avro serialization/deserialization library in Rust, how we were able to call it from Python (and in theory from any other language) with very little code, using tools such as cbindgen, CFFI and Milksnake.
This talk would outline how easy it is to write interoperable code in a performant language like Rust and why a company should invest in Rust, over the many other available alternatives, to run production services.
Bytes in the Machine: Inside the CPython interpreterakaptur
This document discusses Byterun, an interpreter for Python written in Python. It explains key concepts in interpreting Python like lexing, parsing, compiling and interpreting. It describes how a Python virtual machine works using a stack and frames. It shows Python bytecode and how an interpreter executes instructions like LOAD_FAST, BINARY_MODULO, and RETURN_VALUE. It demonstrates that instructions must account for Python's dynamic nature, like strings being able to use % formatting like integers. The goal is to build an interpreter that can run Python programs directly in Python.
This document discusses using the prove command-line tool to run tests and other scripts. Prove is a test runner that uses the Test Anything Protocol (TAP) to aggregate results. It can run tests and scripts written in any language by specifying the interpreter with --exec. Extensions other than .t can be run by setting --ext. Prove searches for tests in the t/ directory by default but can run any kind of scripts or tasks placed in t/, such as service monitoring scripts. The .proverc file can save common prove options for a project.
TVM uses Verilator and DPI to connect Verilog/Chisel accelerator models written in SystemVerilog/Chisel to Python code. It initializes the hardware model and controls simulation using methods like SimLaunch, SimWait, SimResume. The Python code loads the accelerator module, allocates memory, runs the accelerator by calling driver functions that interface with the DPI to initialize, launch and wait for completion of the accelerator. This allows accelerators developed in Verilog/Chisel to be tested from Python.
- The document discusses various aspects of Unix programming using Perl, including handling errors, filehandles after forking processes, and signals.
- It provides examples of how to properly check for errors, avoid resource collisions after forking, and make code cancellable using signals.
- Key topics covered include using the Errno module to check for errors, closing filehandles after forks to prevent sharing issues, and trapping signals like SIGPIPE and SIGTERM.
The document discusses the Dtrace tool for debugging, profiling, and monitoring systems. It provides an overview of Dtrace's key components like the D language, probes, consumers, and providers. Examples are given for using Dtrace for debugging issues by tracing function calls, gathering statistics on memory allocation, and visualizing process flow.
This document summarizes the history and future of PHP. It discusses the creators of PHP (Rasmus Lerdorf, Zeev Suraski, John Morris) and outlines the major versions released from PHP 1.0 in 1995 to the upcoming PHP 8.0, which will include features like FFI, JIT compilation, and asynchronous programming. It also previews potential features for future PHP versions such as OpCache core improvements and extending the instanceof operator.
The document discusses ActionScript and the ActionScript Virtual Machine 2 (AVM2). It provides examples of ActionScript bytecode (ABC) and instructions. It compares AVM1 and AVM2, and explains how AVM2 improved performance through just-in-time compilation and garbage collection. Code examples demonstrate how to compile and disassemble ABC files using tools like Flex SDK and Tamarin.
How to write rust instead of c and get away with itFlavien Raynaud
Ever tried optimizing a slow Python application and thought: “Oh! I wish I could just write this bit it in Rust”? Well, turns out you can! Let’s discuss why Rust is a better choice than C, how to use Rust to make your apps lightning fast and how to get away with it; without your users even noticing.
As Infrastructure Engineers at Yelp, the challenge we face everyday is: scale. Yelp is mostly a Python shop, so our work often revolves around making Python applications run faster. Until now, we have been using different techniques: faster interpreters, or, more often, C code.
Given its safety guarantees, performance and promise of better tooling than C, we decided we had to give Rust a try. The initial results helped reinforce that there was a lot of opportunity for Rust to play an important role in our production code.
Yelp heavily relies on the Apache Avro serialization format for its internal infrastructure. During the talk, we will show how we implemented avro-rs, an Avro serialization/deserialization library in Rust, how we were able to call it from Python (and in theory from any other language) with very little code, using tools such as cbindgen, CFFI and Milksnake.
This talk would outline how easy it is to write interoperable code in a performant language like Rust and why a company should invest in Rust, over the many other available alternatives, to run production services.
Bytes in the Machine: Inside the CPython interpreterakaptur
This document discusses Byterun, an interpreter for Python written in Python. It explains key concepts in interpreting Python like lexing, parsing, compiling and interpreting. It describes how a Python virtual machine works using a stack and frames. It shows Python bytecode and how an interpreter executes instructions like LOAD_FAST, BINARY_MODULO, and RETURN_VALUE. It demonstrates that instructions must account for Python's dynamic nature, like strings being able to use % formatting like integers. The goal is to build an interpreter that can run Python programs directly in Python.
This document discusses using the prove command-line tool to run tests and other scripts. Prove is a test runner that uses the Test Anything Protocol (TAP) to aggregate results. It can run tests and scripts written in any language by specifying the interpreter with --exec. Extensions other than .t can be run by setting --ext. Prove searches for tests in the t/ directory by default but can run any kind of scripts or tasks placed in t/, such as service monitoring scripts. The .proverc file can save common prove options for a project.
TVM uses Verilator and DPI to connect Verilog/Chisel accelerator models written in SystemVerilog/Chisel to Python code. It initializes the hardware model and controls simulation using methods like SimLaunch, SimWait, SimResume. The Python code loads the accelerator module, allocates memory, runs the accelerator by calling driver functions that interface with the DPI to initialize, launch and wait for completion of the accelerator. This allows accelerators developed in Verilog/Chisel to be tested from Python.
- The document discusses various aspects of Unix programming using Perl, including handling errors, filehandles after forking processes, and signals.
- It provides examples of how to properly check for errors, avoid resource collisions after forking, and make code cancellable using signals.
- Key topics covered include using the Errno module to check for errors, closing filehandles after forks to prevent sharing issues, and trapping signals like SIGPIPE and SIGTERM.
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionFelipe Prado
1. The document discusses repurposing existing malware samples for offensive security purposes such as testing defenses or creating custom tools.
2. Specific examples analyzed include repurposing the OSX.FruitFly backdoor to specify custom command and control servers, repurposing the OSX.CreativeUpdate miner to change mining accounts, and repurposing the OSX.Keranger ransomware to use custom encryption and servers.
3. The techniques demonstrated include understanding malware capabilities, patching command and control protocols, avoiding antivirus detection, and creating new installers or payloads.
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...akaptur
The document discusses the inner workings of the Python virtual machine and bytecode. It explains that Python code is compiled to bytecode, which is then interpreted by a large switch statement in the Python virtual machine. The bytecode consists of numeric codes and arguments that correspond to stack-based operations. It provides examples of disassembling bytecode into a more human-readable format and how the virtual machine handles dynamic operations like string formatting and operator overloading.
This document contains a lecture on working with arrays, scripts, and SSH/SCP in UNIX systems. It discusses special variables used in scripts, how to define and manipulate arrays, examples of useful scripts for renaming files, backing up data, and extracting video files from DVDs, and how to use SSH to securely connect to remote systems and SCP to securely transfer files between systems. It also covers generating and using public/private key pairs for passwordless SSH login.
The document defines a class called ofBlob that represents a circle object that can be drawn and manipulated. It includes private variables to store the blob's position, dimension, speed, and phase. Methods are defined to initialize the blob, set/get its properties, update its position, and draw it. A testApp class is also defined that initializes a vector of ofBlob objects and calls their update and draw methods in a loop.
The document summarizes techniques for Unix programming with Perl, focusing on advanced topics like inter-process communication, signals, and avoiding race conditions. It discusses using IPC::Open3 to avoid deadlocks when communicating between processes via pipes. It also covers how to safely sleep while waiting for a signal using POSIX::pselect or a socketpair to avoid race conditions. Proper error handling for signals is mentioned but not shown.
This document provides a history of ECMAScript (ES) and JavaScript standards. It discusses the origins of JavaScript in 1995 and its standardization by ECMA in 1997 as ECMAScript. New versions were released periodically, including ES5 in 2009 and ES6 in 2015. ES6 was also referred to as ES2015 since version names going forward would be based on the year of release.
This document provides an overview of ES6 features and how to set them up for use in Ruby on Rails applications. It describes key ES6 features such as let and const block scoping, template strings, destructuring assignment, default and rest parameters, loops and generators, enhanced object literals, Maps and Sets, arrow functions, modules, and classes. It then provides instructions for using the sprockets-es6 gem to transpile ES6 code to ES5 for use in Rails, as well as using Node.js and Gulp as an alternative approach.
This document provides an introduction to JavaScript fundamentals and common patterns, jQuery optimization techniques, and an introduction to Node.js. It discusses JavaScript data types and variables, scoping, objects and classes. It also covers immediate execution functions, private patterns, event attaching in jQuery, and dependency management in Node.js projects. The document includes code examples for selecting elements and caching selectors in jQuery as well as creating an Express server and using middleware in Node.js applications.
lldb kann mehr als nur einfache Breakpoints oder po. In dem Vortrag zeigt Oliver Bayer, wie sich mit Hilfe von lldb Programmcode zur Ausführungszeit manipulieren lässt, ohne das hierfür der Sourcecode anzupassen ist. Sei es, damit Test- oder Debugcode nicht in die produktiv App gelangt, oder weil der Sourcecode für einen Teil der App nicht vorliegt.
Event: macoun, 04.10.2019
Speaker: Oliver Bayer, inovex
Mehr Tech-Vorträge: inovex.de/vortraege
Mehr Tech-Artikel: inovex.de/blog
This document provides information about the 8th semester Network Security lab practical course for Computer Science and Engineering students at Shri Rawatpura Sarkar Institute of Technology-II in New Raipur, Chhattisgarh, India. It lists 10 experiments to be performed related to network security programming using TCP/IP, sockets, APIs, web security, cryptography, and more. It also provides sample code for some of the experiments and recommends books for reference.
The document discusses the virtual filesystem (VFS) and the process of mounting the root filesystem during system bootup. It explains that the VFS acts as an interface between the kernel and actual filesystem implementations. During bootup, the following key steps occur:
1. The root filesystem is mounted
2. Directories are created based on the initramfs
3. Additional directories are created based on the ramdisk
4. Default mounts like tmpfs, devpts, proc and sysfs are performed
5. The init process mounts additional filesystems like data, system based on the init.rc file
This document provides a history of JavaScript and ECMAScript specifications from 1995 to the present. It discusses the standardization process and key people and organizations involved like B. Eich, TC39, and ECMA. Major versions and proposed features are summarized, including ES6/ES2015 additions like arrow functions, block scoping with let/const, classes, modules, iterators/generators, and proxies.
The document contains code snippets for Java network security programming. Experiment 1 deals with network security programming using TCP/IP protocols for different layers. Experiment 2 focuses on socket security programming involving address structures and functions. Experiment 3 is about APIs security programming for non-blocking sockets and timeouts. Experiment 4 implements a basic web server for firewall programming. The remaining experiments cover CORBA, cryptography, digital signatures and Java network security in general.
The document provides an introduction to using DotCloud and Go. It discusses deploying a Perl application on DotCloud, including defining services in dotcloud.yml, connecting services to each other using environment variables, and pushing code to DotCloud. It also covers troubleshooting applications running on DotCloud using commands like dotcloud logs and dotcloud run.
The document discusses strategies for understanding the CPython implementation of Python without reading the code. It recommends using observation and experimentation techniques like inspecting code behavior, examining commit histories, understanding internal structures through disassembly, running performance tests, and writing tests. Tools mentioned include inspect, timeit, and custom inspection modules. The key message is that these hands-on techniques allow one to critically examine and experiment with the code in ways that provide deeper understanding than just reading it.
This document discusses ways to prevent malicious Perl code from executing harmful actions by overriding core functions like die() and system() as well as by faking module imports. It explores how the Acme::BadExample module tries to perform dangerous tasks and ways Anti::Code can intervene to stop it without errors.
This document discusses randomization functions in PHP like shuffle() and str_shuffle(). It examines how the implementations have changed over time in PHP versions. Specifically, it finds that earlier versions of shuffle() and str_shuffle() did not produce truly random results due to issues with the random number generation. The current implementations in recent PHP versions do properly randomize the values, but the document proposes reimplementing shuffle() to use mt_rand() for improved consistency across environments.
This document provides information about the Security Lab course conducted at R.M.K. College of Engineering and Technology. It lists the objectives of the course as exposing students to cipher techniques, encryption algorithms like DES, RSA, MD5 and SHA-1, and security tools like GnuPG, KF Sensor and NetStumbler. It provides details of 8 experiments to be performed in the lab related to substitution and transposition ciphers, encryption algorithms, digital signatures, secure data storage and transmission, honeypot setup, rootkit installation and intrusion detection. It also lists the expected outcomes, lab equipment requirements and software to be used for the course.
Kotlin Coroutines provide a new way to write asynchronous and concurrent code using suspending functions and structured concurrency. Coroutines avoid callbacks and allow sequencing of asynchronous code using async/await. Coroutines are lightweight threads that can be suspended and resumed. Channels allow coroutines to communicate and share data. Flows provide a reactive streams API for coroutines. Kotlin coroutines offer improvements over other asynchronous programming models like callbacks and RxJava.
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6FrontDays
Общий обзор новых возможностей ES6, сравнение с более ранними стандартами. Почему стоит использовать ES6 уже сейчас? Поговорим о таких нововведениях как: поддержка классов, шаблоны строк, модули, стрелочные функции, генераторы и о многом другом.
Functional MCU programming #0: Development environmentKiwamu Okabe
This document provides an overview of using functional programming languages for microcontroller (MCU) development. It discusses common MCU architectures like ARM Cortex-M, MSP430, and AVR. It recommends the Ajhc Haskell compiler, Rust, and ATS as functional languages suitable for MCUs. It also discusses debuggers like OpenOCD, pyOCD, STLINK, and AVaRICE. Real-time operating systems like FreeRTOS, ChibiOS/RT, and mbed RTOS are presented. Setup instructions are provided for Ajhc, GCC toolchain, pyOCD, and STLINK. Example code links are included.
This document discusses setting up Travis CI to build OS X applications. It provides instructions for configuring a .travis.yml file to install the Haskell Platform and other dependencies on OS X, run scripts for building and testing, and demonstrates building the Ajhc Haskell compiler which runs on tiny embedded systems. It also promotes the author's Haskell compiler project and functional programming fanzine seeking article submissions.
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionFelipe Prado
1. The document discusses repurposing existing malware samples for offensive security purposes such as testing defenses or creating custom tools.
2. Specific examples analyzed include repurposing the OSX.FruitFly backdoor to specify custom command and control servers, repurposing the OSX.CreativeUpdate miner to change mining accounts, and repurposing the OSX.Keranger ransomware to use custom encryption and servers.
3. The techniques demonstrated include understanding malware capabilities, patching command and control protocols, avoiding antivirus detection, and creating new installers or payloads.
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...akaptur
The document discusses the inner workings of the Python virtual machine and bytecode. It explains that Python code is compiled to bytecode, which is then interpreted by a large switch statement in the Python virtual machine. The bytecode consists of numeric codes and arguments that correspond to stack-based operations. It provides examples of disassembling bytecode into a more human-readable format and how the virtual machine handles dynamic operations like string formatting and operator overloading.
This document contains a lecture on working with arrays, scripts, and SSH/SCP in UNIX systems. It discusses special variables used in scripts, how to define and manipulate arrays, examples of useful scripts for renaming files, backing up data, and extracting video files from DVDs, and how to use SSH to securely connect to remote systems and SCP to securely transfer files between systems. It also covers generating and using public/private key pairs for passwordless SSH login.
The document defines a class called ofBlob that represents a circle object that can be drawn and manipulated. It includes private variables to store the blob's position, dimension, speed, and phase. Methods are defined to initialize the blob, set/get its properties, update its position, and draw it. A testApp class is also defined that initializes a vector of ofBlob objects and calls their update and draw methods in a loop.
The document summarizes techniques for Unix programming with Perl, focusing on advanced topics like inter-process communication, signals, and avoiding race conditions. It discusses using IPC::Open3 to avoid deadlocks when communicating between processes via pipes. It also covers how to safely sleep while waiting for a signal using POSIX::pselect or a socketpair to avoid race conditions. Proper error handling for signals is mentioned but not shown.
This document provides a history of ECMAScript (ES) and JavaScript standards. It discusses the origins of JavaScript in 1995 and its standardization by ECMA in 1997 as ECMAScript. New versions were released periodically, including ES5 in 2009 and ES6 in 2015. ES6 was also referred to as ES2015 since version names going forward would be based on the year of release.
This document provides an overview of ES6 features and how to set them up for use in Ruby on Rails applications. It describes key ES6 features such as let and const block scoping, template strings, destructuring assignment, default and rest parameters, loops and generators, enhanced object literals, Maps and Sets, arrow functions, modules, and classes. It then provides instructions for using the sprockets-es6 gem to transpile ES6 code to ES5 for use in Rails, as well as using Node.js and Gulp as an alternative approach.
This document provides an introduction to JavaScript fundamentals and common patterns, jQuery optimization techniques, and an introduction to Node.js. It discusses JavaScript data types and variables, scoping, objects and classes. It also covers immediate execution functions, private patterns, event attaching in jQuery, and dependency management in Node.js projects. The document includes code examples for selecting elements and caching selectors in jQuery as well as creating an Express server and using middleware in Node.js applications.
lldb kann mehr als nur einfache Breakpoints oder po. In dem Vortrag zeigt Oliver Bayer, wie sich mit Hilfe von lldb Programmcode zur Ausführungszeit manipulieren lässt, ohne das hierfür der Sourcecode anzupassen ist. Sei es, damit Test- oder Debugcode nicht in die produktiv App gelangt, oder weil der Sourcecode für einen Teil der App nicht vorliegt.
Event: macoun, 04.10.2019
Speaker: Oliver Bayer, inovex
Mehr Tech-Vorträge: inovex.de/vortraege
Mehr Tech-Artikel: inovex.de/blog
This document provides information about the 8th semester Network Security lab practical course for Computer Science and Engineering students at Shri Rawatpura Sarkar Institute of Technology-II in New Raipur, Chhattisgarh, India. It lists 10 experiments to be performed related to network security programming using TCP/IP, sockets, APIs, web security, cryptography, and more. It also provides sample code for some of the experiments and recommends books for reference.
The document discusses the virtual filesystem (VFS) and the process of mounting the root filesystem during system bootup. It explains that the VFS acts as an interface between the kernel and actual filesystem implementations. During bootup, the following key steps occur:
1. The root filesystem is mounted
2. Directories are created based on the initramfs
3. Additional directories are created based on the ramdisk
4. Default mounts like tmpfs, devpts, proc and sysfs are performed
5. The init process mounts additional filesystems like data, system based on the init.rc file
This document provides a history of JavaScript and ECMAScript specifications from 1995 to the present. It discusses the standardization process and key people and organizations involved like B. Eich, TC39, and ECMA. Major versions and proposed features are summarized, including ES6/ES2015 additions like arrow functions, block scoping with let/const, classes, modules, iterators/generators, and proxies.
The document contains code snippets for Java network security programming. Experiment 1 deals with network security programming using TCP/IP protocols for different layers. Experiment 2 focuses on socket security programming involving address structures and functions. Experiment 3 is about APIs security programming for non-blocking sockets and timeouts. Experiment 4 implements a basic web server for firewall programming. The remaining experiments cover CORBA, cryptography, digital signatures and Java network security in general.
The document provides an introduction to using DotCloud and Go. It discusses deploying a Perl application on DotCloud, including defining services in dotcloud.yml, connecting services to each other using environment variables, and pushing code to DotCloud. It also covers troubleshooting applications running on DotCloud using commands like dotcloud logs and dotcloud run.
The document discusses strategies for understanding the CPython implementation of Python without reading the code. It recommends using observation and experimentation techniques like inspecting code behavior, examining commit histories, understanding internal structures through disassembly, running performance tests, and writing tests. Tools mentioned include inspect, timeit, and custom inspection modules. The key message is that these hands-on techniques allow one to critically examine and experiment with the code in ways that provide deeper understanding than just reading it.
This document discusses ways to prevent malicious Perl code from executing harmful actions by overriding core functions like die() and system() as well as by faking module imports. It explores how the Acme::BadExample module tries to perform dangerous tasks and ways Anti::Code can intervene to stop it without errors.
This document discusses randomization functions in PHP like shuffle() and str_shuffle(). It examines how the implementations have changed over time in PHP versions. Specifically, it finds that earlier versions of shuffle() and str_shuffle() did not produce truly random results due to issues with the random number generation. The current implementations in recent PHP versions do properly randomize the values, but the document proposes reimplementing shuffle() to use mt_rand() for improved consistency across environments.
This document provides information about the Security Lab course conducted at R.M.K. College of Engineering and Technology. It lists the objectives of the course as exposing students to cipher techniques, encryption algorithms like DES, RSA, MD5 and SHA-1, and security tools like GnuPG, KF Sensor and NetStumbler. It provides details of 8 experiments to be performed in the lab related to substitution and transposition ciphers, encryption algorithms, digital signatures, secure data storage and transmission, honeypot setup, rootkit installation and intrusion detection. It also lists the expected outcomes, lab equipment requirements and software to be used for the course.
Kotlin Coroutines provide a new way to write asynchronous and concurrent code using suspending functions and structured concurrency. Coroutines avoid callbacks and allow sequencing of asynchronous code using async/await. Coroutines are lightweight threads that can be suspended and resumed. Channels allow coroutines to communicate and share data. Flows provide a reactive streams API for coroutines. Kotlin coroutines offer improvements over other asynchronous programming models like callbacks and RxJava.
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6FrontDays
Общий обзор новых возможностей ES6, сравнение с более ранними стандартами. Почему стоит использовать ES6 уже сейчас? Поговорим о таких нововведениях как: поддержка классов, шаблоны строк, модули, стрелочные функции, генераторы и о многом другом.
Functional MCU programming #0: Development environmentKiwamu Okabe
This document provides an overview of using functional programming languages for microcontroller (MCU) development. It discusses common MCU architectures like ARM Cortex-M, MSP430, and AVR. It recommends the Ajhc Haskell compiler, Rust, and ATS as functional languages suitable for MCUs. It also discusses debuggers like OpenOCD, pyOCD, STLINK, and AVaRICE. Real-time operating systems like FreeRTOS, ChibiOS/RT, and mbed RTOS are presented. Setup instructions are provided for Ajhc, GCC toolchain, pyOCD, and STLINK. Example code links are included.
This document discusses setting up Travis CI to build OS X applications. It provides instructions for configuring a .travis.yml file to install the Haskell Platform and other dependencies on OS X, run scripts for building and testing, and demonstrates building the Ajhc Haskell compiler which runs on tiny embedded systems. It also promotes the author's Haskell compiler project and functional programming fanzine seeking article submissions.
The document discusses an attempt to use Play, Slick, and play2-auth together for a web application project. It describes setting up the build configuration and dependencies, defining Account and Role models using Slick, and implementing authentication and authorization logic. However, the author encountered difficulties after only one month of using Scala and was not able to complete the implementation.
This document discusses functional programming on microcontroller units (MCUs) and summarizes the speaker's workshop on this topic. It explores reasons for using functional languages on MCUs and Internet of Things devices due to benefits like strong typing and runtime error avoidance. Several cross-compilers from functional languages to C suitable for MCUs are presented, like Ajhc for Haskell and Rust, along with experiences running them on boards like the mbed LPC1768 and Seeeduino Arch Pro. Debugging options using pyOCD and OpenOCD are also covered.
The document discusses using the ATS functional programming language to develop safer IoT applications for the ESP8266 WiFi module. ATS supports dependent types, linear types, and optional memory management features that could help prevent common issues like memory safety bugs. The document outlines a demo project implementing JSON output on the ESP8266 using ATS and points out how the type system helps catch errors related to freeing memory correctly. It also advertises an upcoming meetup to discuss functional IoT development further.
Create an auto-extractible shell script linuxThierry Gayet
The document describes how to create an auto-extractible shell script by concatenating three scripts: an "extract.sh" script to extract data from the self-extracting script, an "install.sh" script to install the extracted data, and a "build.sh" script to generate the self-extracting script by combining "install.sh", "extract.sh", and the software data. The "build.sh" script generates a temporary archive of the data and concatenates it with "extract.sh" to create the self-extracting script. When run, the self-extracting script uses "extract.sh" to extract the archived data and then run "install.sh" to install
The document discusses various ways to embed Perl in C and C in Perl. It provides an overview of embedding Perl in C using ExtUtils::Embed, B::C, and XS. It also covers embedding C code in Perl using Inline::C and XS. Finally, it demonstrates examples of calling Perl functions from C code and evaluating Perl code from embedded C programs.
This document provides instructions for setting up and running a Linux system simulation using the Skyeye simulator for ARM architectures. The steps include: 1) Installing Skyeye and a cross-compiler toolchain; 2) Compiling a Linux kernel and filesystem utilities; 3) Creating a root filesystem image; 4) Configuring and running Skyeye with the kernel and filesystem image. This allows testing a complete Linux system without requiring dedicated ARM hardware.
This document discusses PostgreSQL and Solaris as a low-cost platform for medium to large scale critical scenarios. It provides an overview of PostgreSQL, highlighting features like MVCC, PITR, and ACID compliance. It describes how Solaris and PostgreSQL integrate well, with benefits like DTrace support, scalability on multicore/multiprocessor systems, and Solaris Cluster support. Examples are given for installing PostgreSQL on Solaris using different methods, configuring zones for isolation, using ZFS for storage, and monitoring performance with DTrace scripts.
seccomp is a computer security facility in the Linux kernel, pledge is a similar security facility in the OpenBSD kernel. In this presentation Giovanni Bechis will review the development story and progress of both kernel interfaces and will analyze the main differences. There will be some examples of implementations of security patches made for some important open source projects.
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Vincenzo Iozzo
Charlie Miller and Vincenzo Iozzo presented techniques for post-exploitation on the iPhone 2 including:
1. Running arbitrary shellcode by overwriting memory protections and calling vm_protect to mark pages as read/write/executable.
2. Loading an unsigned dynamic library called Meterpreter by mapping it over an existing signed library, patching dyld to ignore code signing, and forcing unloaded of linked libraries.
3. Adding new functionality to Meterpreter, such as a module to vibrate and play a sound on the iPhone, demonstrating how payloads can be extended once loaded into memory.
Basicsof c make and git for a hello qt applicationDinesh Manajipet
This document provides an overview of using CMake and Git for a Hello World application in C, Qt, and managing source code with Git. It demonstrates how to configure CMake files to compile Hello World programs in C and Qt. It also summarizes basic Git commands like init, add, commit, branch, merge, and rebase. Useful online resources for learning more about CMake, Qt, and Git are provided.
The document discusses different implementations of shared pointers in C++ and proposes an adaptive approach. It summarizes three common implementations of shared pointers: invasive, slim, and fat. It then proposes a "linked small pointer" implementation that is optimized for small object counts by using a linked list instead of a reference count. For larger object counts, it would transition to a traditional reference counted implementation. Finally, it proposes an "adaptive linked pointer" that uses unused bits in pointers to track reference counts for smaller objects and dynamically transitions between the linked and reference counted approaches. Benchmark results show this adaptive approach has performance comparable to traditional implementations.
This sample program demonstrates how to access Meinberg GPS receivers via the binary data protocol. It can work via a serial port or network socket connection depending on the target operating system. It requires several other modules and supports Windows, Linux, QNX, and DOS targets. The program checks return codes from API functions, gets receiver information, status information, position, time zone, and synthesizer settings. It also has the ability to set the synthesizer frequency and phase.
The document discusses the Rust programming language, highlighting its features like concurrency, safety, and package management. It covers Rust's syntax including expressions, attributes, pattern matching and generics. The document also discusses how Rust handles concurrency through tasks and channels to enable safe parallelism and communication between threads.
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak PROIDEA
This document summarizes a presentation about using DTrace on OS X. It introduces DTrace as a dynamic tracing tool for user and kernel space. It discusses the D programming language used for writing DTrace scripts, including data types, variables, operators, and actions. Example one-liners and scripts are provided to demonstrate syscall tracking, memory allocation snooping, and hit tracing. The presentation outlines some past security work using DTrace and similar dynamic tracing tools. It concludes with proposing future work like more kernel and USDT tracing as well as Python bindings for DTrace.
Capture the Flag (CTF) are information security challenges. They are fun, but they also provide a opportunity to practise for real-world security challenges.
In this talk we present the concept of CTF. We focus on some tools used by our team, which can also be used to solve real-world problems.
various tricks for remote linux exploits by Seok-Ha Lee (wh1ant)CODE BLUE
Modern operating systems include hardened security mechanisms to block exploit attempts. ASLR and NX (DEP) are two examples of the mechanisms that are widely implemented for the sake of security. However, there exists ways to bypass such protections by leveraging advanced exploitation techniques. It becomes harder to achieve code execution when the exploitation originates from a remote location, such as when the attack originates from a client, targeting server daemons. In such cases it is harder to find out the context information of target systems and, therefore, harder to achieve code execution. Knowledge on the memory layout of the targeted process is a crucial piece of the puzzle in developing an exploit, but it is harder to figure out when the exploit attempt is performed remotely. Recently, there have been techniques to leverage information disclosure (memory leak) vulnerabilities to figure out where specific library modules are loaded in the memory layout space, and such classes of vulnerabilities have been proven to be useful to bypass ASLR. However, there is also a different way of figuring out the memory layout of a process running in a remote environment. This method involves probing for valid addresses in target remote process. In a Linux environment, forked child processes will inherit already randomized memory layout from the parent process. Thus every client connection made to server daemons will share the same memory layout. The memory layout randomization is only done during the startup of the parent service process, and not randomized again when it is forking a child process to handle client connections. Due to the inheritance of child processes, it is possible to figure out a small piece of different information from every connection, and these pieces can be assembled later to get the idea of a big picture of the target process's remote memory layout. Probing to see if a given address is a valid memory address in context of the target remote process and assembling such information together, an attacker can figure out where the libc library is loaded on the memory, thus allowing exploits to succeed further in code execution. One might call it brute force, but with a smart brute forcing strategy, the number of minimal required attempts are significantly reduced to less than 10 in usual cases. In this talk, we will be talking about how it is possible to probe for memory layout space utilizing a piece of code to put the target in a blocked state, and to achieve stable code execution in remote exploit attempt scenarios using such information, as well as other tricks that are often used in remote exploit development in the Linux environment.
http://codeblue.jp/en-speaker.html#SeokHaLee
The document provides an introduction to kernel coding and demystifies kernel programming. It discusses key concepts like context of execution, interfaces, registration, interrupts, I/O, and manipulating user memory from the kernel. The key aspects covered are the general patterns for registering interfaces, examples of interrupt handling and deferred work, addressing spaces when calling between user/kernel, and manipulating virtual memory areas. Examples of specific subsystems like filesystems, framebuffers, sound, and storage drivers are provided.
The document discusses ways to determine where functions in a Linux kernel module are called from without using a debugger like JTAG or KGDB. It presents two methods:
1. Using the GCC built-in function __builtin_return_address(0) inside a macro to print the return address and lookup the calling function symbol. This shows the direct caller but may only show one level in ARM.
2. Calling the dump_stack() function, which prints a stack trace like panic() does. This can show the full call sequence back to the initial caller. The example prints the calls to a test module's init and exit functions.
Both methods allow determining the direct and indirect callers without an external
This document analyzes the $BOARDNAME.h file in U-boot. It describes the contents and purpose of this important file that defines board-specific configurations for U-boot. It provides examples of definitions for the Mango100 board related to memory layout, boot settings, Ethernet/USB configurations, and NAND support.
Rust — это современный, практический, быстрый и безопасный язык программирования. Некоторые говорят, что Rust — это как C++, если бы его писал человек, знающий Haskell.
Система типов Rust решает главную проблему C++ — небезопасность. C++ очень легко сделать ошибки, которые приведут к поломкам (например, use after free). Rust позволяет писать безопасный код, сохраняя при этом выразительность и околонулевые накладные расходы C++. В докладе будут подробно описаны механизмы языка, которые контролируют безопасность программы.
Хотя в данный момент Rust ещё не подходит для использования в продакшне, его всё равно стоит изучать. Во-первых, потому что это очень интересный подход к программированию, а во-вторых, потому что через несколько лет для разработки требовательных к ресурсам программ будет необходим именно Rust или другой похожий инструмент.
Similar to start_printf: dev/ic/com.c comstart() (20)
This presentation provides valuable insights into effective cost-saving techniques on AWS. Learn how to optimize your AWS resources by rightsizing, increasing elasticity, picking the right storage class, and choosing the best pricing model. Additionally, discover essential governance mechanisms to ensure continuous cost efficiency. Whether you are new to AWS or an experienced user, this presentation provides clear and practical tips to help you reduce your cloud costs and get the most out of your budget.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on automated letter generation for Bonterra Impact Management using Google Workspace or Microsoft 365.
Interested in deploying letter generation automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfflufftailshop
When it comes to unit testing in the .NET ecosystem, developers have a wide range of options available. Among the most popular choices are NUnit, XUnit, and MSTest. These unit testing frameworks provide essential tools and features to help ensure the quality and reliability of code. However, understanding the differences between these frameworks is crucial for selecting the most suitable one for your projects.
7. comstart() #1comstart() #1comstart() #1comstart() #1comstart() #1
void
comstart(struct tty *tp)
{
struct com_softc *sc =
device_lookup_private(&com_cd, COMUNIT(tp->t_dev));
struct com_regs *regsp = &sc->sc_regs;
int s;
if (COM_ISALIVE(sc) == 0)
return;
s = spltty();
if (ISSET(tp->t_state, TS_BUSY | TS_TIMEOUT | TS_TTSTOP))
goto out;
if (sc->sc_tx_stopped)
goto out;
if (!ttypull(tp))
goto out;
void
comstart(struct tty *tp)
{
struct com_softc *sc =
device_lookup_private(&com_cd, COMUNIT(tp->t_dev));
struct com_regs *regsp = &sc->sc_regs;
int s;
if (COM_ISALIVE(sc) == 0)
return;
s = spltty();
if (ISSET(tp->t_state, TS_BUSY | TS_TIMEOUT | TS_TTSTOP))
goto out;
if (sc->sc_tx_stopped)
goto out;
if (!ttypull(tp))
goto out;
void
comstart(struct tty *tp)
{
struct com_softc *sc =
device_lookup_private(&com_cd, COMUNIT(tp->t_dev));
struct com_regs *regsp = &sc->sc_regs;
int s;
if (COM_ISALIVE(sc) == 0)
return;
s = spltty();
if (ISSET(tp->t_state, TS_BUSY | TS_TIMEOUT | TS_TTSTOP))
goto out;
if (sc->sc_tx_stopped)
goto out;
if (!ttypull(tp))
goto out;
void
comstart(struct tty *tp)
{
struct com_softc *sc =
device_lookup_private(&com_cd, COMUNIT(tp->t_dev));
struct com_regs *regsp = &sc->sc_regs;
int s;
if (COM_ISALIVE(sc) == 0)
return;
s = spltty();
if (ISSET(tp->t_state, TS_BUSY | TS_TIMEOUT | TS_TTSTOP))
goto out;
if (sc->sc_tx_stopped)
goto out;
if (!ttypull(tp))
goto out;
void
comstart(struct tty *tp)
{
struct com_softc *sc =
device_lookup_private(&com_cd, COMUNIT(tp->t_dev));
struct com_regs *regsp = &sc->sc_regs;
int s;
if (COM_ISALIVE(sc) == 0)
return;
s = spltty();
if (ISSET(tp->t_state, TS_BUSY | TS_TIMEOUT | TS_TTSTOP))
goto out;
if (sc->sc_tx_stopped)
goto out;
if (!ttypull(tp))
goto out;
8. ttypull()ttypull()ttypull()ttypull()ttypull()
/*
* Try to pull more output from the producer. Return non-zero if
* there is output ready to be sent.
*/
bool
ttypull(struct tty *tp)
{
/* XXXSMP not yet KASSERT(mutex_owned(&tty_lock)); */
if (tp->t_outq.c_cc <= tp->t_lowat) {
cv_broadcast(&tp->t_outcv);
selnotify(&tp->t_wsel, 0, NOTE_SUBMIT);
}
return tp->t_outq.c_cc != 0;
}
/*
* Try to pull more output from the producer. Return non-zero if
* there is output ready to be sent.
*/
bool
ttypull(struct tty *tp)
{
/* XXXSMP not yet KASSERT(mutex_owned(&tty_lock)); */
if (tp->t_outq.c_cc <= tp->t_lowat) {
cv_broadcast(&tp->t_outcv);
selnotify(&tp->t_wsel, 0, NOTE_SUBMIT);
}
return tp->t_outq.c_cc != 0;
}
/*
* Try to pull more output from the producer. Return non-zero if
* there is output ready to be sent.
*/
bool
ttypull(struct tty *tp)
{
/* XXXSMP not yet KASSERT(mutex_owned(&tty_lock)); */
if (tp->t_outq.c_cc <= tp->t_lowat) {
cv_broadcast(&tp->t_outcv);
selnotify(&tp->t_wsel, 0, NOTE_SUBMIT);
}
return tp->t_outq.c_cc != 0;
}
/*
* Try to pull more output from the producer. Return non-zero if
* there is output ready to be sent.
*/
bool
ttypull(struct tty *tp)
{
/* XXXSMP not yet KASSERT(mutex_owned(&tty_lock)); */
if (tp->t_outq.c_cc <= tp->t_lowat) {
cv_broadcast(&tp->t_outcv);
selnotify(&tp->t_wsel, 0, NOTE_SUBMIT);
}
return tp->t_outq.c_cc != 0;
}
/*
* Try to pull more output from the producer. Return non-zero if
* there is output ready to be sent.
*/
bool
ttypull(struct tty *tp)
{
/* XXXSMP not yet KASSERT(mutex_owned(&tty_lock)); */
if (tp->t_outq.c_cc <= tp->t_lowat) {
cv_broadcast(&tp->t_outcv);
selnotify(&tp->t_wsel, 0, NOTE_SUBMIT);
}
return tp->t_outq.c_cc != 0;
}
9. comstart() #2comstart() #2comstart() #2comstart() #2comstart() #2
/* Grab the first contiguous region of buffer space. */
{
u_char *tba;
int tbc;
tba = tp->t_outq.c_cf;
tbc = ndqb(&tp->t_outq, 0);
mutex_spin_enter(&sc->sc_lock);
sc->sc_tba = tba;
sc->sc_tbc = tbc;
}
SET(tp->t_state, TS_BUSY);
sc->sc_tx_busy = 1;
/* Grab the first contiguous region of buffer space. */
{
u_char *tba;
int tbc;
tba = tp->t_outq.c_cf;
tbc = ndqb(&tp->t_outq, 0);
mutex_spin_enter(&sc->sc_lock);
sc->sc_tba = tba;
sc->sc_tbc = tbc;
}
SET(tp->t_state, TS_BUSY);
sc->sc_tx_busy = 1;
/* Grab the first contiguous region of buffer space. */
{
u_char *tba;
int tbc;
tba = tp->t_outq.c_cf;
tbc = ndqb(&tp->t_outq, 0);
mutex_spin_enter(&sc->sc_lock);
sc->sc_tba = tba;
sc->sc_tbc = tbc;
}
SET(tp->t_state, TS_BUSY);
sc->sc_tx_busy = 1;
/* Grab the first contiguous region of buffer space. */
{
u_char *tba;
int tbc;
tba = tp->t_outq.c_cf;
tbc = ndqb(&tp->t_outq, 0);
mutex_spin_enter(&sc->sc_lock);
sc->sc_tba = tba;
sc->sc_tbc = tbc;
}
SET(tp->t_state, TS_BUSY);
sc->sc_tx_busy = 1;
/* Grab the first contiguous region of buffer space. */
{
u_char *tba;
int tbc;
tba = tp->t_outq.c_cf;
tbc = ndqb(&tp->t_outq, 0);
mutex_spin_enter(&sc->sc_lock);
sc->sc_tba = tba;
sc->sc_tbc = tbc;
}
SET(tp->t_state, TS_BUSY);
sc->sc_tx_busy = 1;
10. ndqb()ndqb()ndqb()ndqb()ndqb()
/*
* Return count of contiguous characters in clist.
* Stop counting if flag&character is non-null.
*/
int
ndqb(struct clist *clp, int flag)
{
int count = 0;
int i;
int cc;
int s;
s = spltty();
if ((cc = clp->c_cc) == 0)
goto out;
// --snip--
out:
splx(s);
return count;
}
/*
* Return count of contiguous characters in clist.
* Stop counting if flag&character is non-null.
*/
int
ndqb(struct clist *clp, int flag)
{
int count = 0;
int i;
int cc;
int s;
s = spltty();
if ((cc = clp->c_cc) == 0)
goto out;
// --snip--
out:
splx(s);
return count;
}
/*
* Return count of contiguous characters in clist.
* Stop counting if flag&character is non-null.
*/
int
ndqb(struct clist *clp, int flag)
{
int count = 0;
int i;
int cc;
int s;
s = spltty();
if ((cc = clp->c_cc) == 0)
goto out;
// --snip--
out:
splx(s);
return count;
}
/*
* Return count of contiguous characters in clist.
* Stop counting if flag&character is non-null.
*/
int
ndqb(struct clist *clp, int flag)
{
int count = 0;
int i;
int cc;
int s;
s = spltty();
if ((cc = clp->c_cc) == 0)
goto out;
// --snip--
out:
splx(s);
return count;
}
/*
* Return count of contiguous characters in clist.
* Stop counting if flag&character is non-null.
*/
int
ndqb(struct clist *clp, int flag)
{
int count = 0;
int i;
int cc;
int s;
s = spltty();
if ((cc = clp->c_cc) == 0)
goto out;
// --snip--
out:
splx(s);
return count;
}
11. struct cliststruct cliststruct cliststruct cliststruct clist
/*
* Clists are actually ring buffers. The c_cc, c_cf, c_cl fields
have
* exactly the same behaviour as in true clists.
* if c_cq is NULL, the ring buffer has no TTY_QUOTE functionality
* (but, saves memory and CPU time)
*
* *DON'T* play with c_cs, c_ce, c_cq, or c_cl outside
tty_subr.c!!!
*/
struct clist {
u_char *c_cf; /* points to first character */
u_char *c_cl; /* points to next open character */
u_char *c_cs; /* start of ring buffer */
u_char *c_ce; /* c_ce + c_len */
u_char *c_cq; /* N bits/bytes long, see tty_subr.c */
int c_cc; /* count of characters in queue */
int c_cn; /* total ring buffer length */
};
/*
* Clists are actually ring buffers. The c_cc, c_cf, c_cl fields
have
* exactly the same behaviour as in true clists.
* if c_cq is NULL, the ring buffer has no TTY_QUOTE functionality
* (but, saves memory and CPU time)
*
* *DON'T* play with c_cs, c_ce, c_cq, or c_cl outside
tty_subr.c!!!
*/
struct clist {
u_char *c_cf; /* points to first character */
u_char *c_cl; /* points to next open character */
u_char *c_cs; /* start of ring buffer */
u_char *c_ce; /* c_ce + c_len */
u_char *c_cq; /* N bits/bytes long, see tty_subr.c */
int c_cc; /* count of characters in queue */
int c_cn; /* total ring buffer length */
};
/*
* Clists are actually ring buffers. The c_cc, c_cf, c_cl fields
have
* exactly the same behaviour as in true clists.
* if c_cq is NULL, the ring buffer has no TTY_QUOTE functionality
* (but, saves memory and CPU time)
*
* *DON'T* play with c_cs, c_ce, c_cq, or c_cl outside
tty_subr.c!!!
*/
struct clist {
u_char *c_cf; /* points to first character */
u_char *c_cl; /* points to next open character */
u_char *c_cs; /* start of ring buffer */
u_char *c_ce; /* c_ce + c_len */
u_char *c_cq; /* N bits/bytes long, see tty_subr.c */
int c_cc; /* count of characters in queue */
int c_cn; /* total ring buffer length */
};
/*
* Clists are actually ring buffers. The c_cc, c_cf, c_cl fields
have
* exactly the same behaviour as in true clists.
* if c_cq is NULL, the ring buffer has no TTY_QUOTE functionality
* (but, saves memory and CPU time)
*
* *DON'T* play with c_cs, c_ce, c_cq, or c_cl outside
tty_subr.c!!!
*/
struct clist {
u_char *c_cf; /* points to first character */
u_char *c_cl; /* points to next open character */
u_char *c_cs; /* start of ring buffer */
u_char *c_ce; /* c_ce + c_len */
u_char *c_cq; /* N bits/bytes long, see tty_subr.c */
int c_cc; /* count of characters in queue */
int c_cn; /* total ring buffer length */
};
/*
* Clists are actually ring buffers. The c_cc, c_cf, c_cl fields
have
* exactly the same behaviour as in true clists.
* if c_cq is NULL, the ring buffer has no TTY_QUOTE functionality
* (but, saves memory and CPU time)
*
* *DON'T* play with c_cs, c_ce, c_cq, or c_cl outside
tty_subr.c!!!
*/
struct clist {
u_char *c_cf; /* points to first character */
u_char *c_cl; /* points to next open character */
u_char *c_cs; /* start of ring buffer */
u_char *c_ce; /* c_ce + c_len */
u_char *c_cq; /* N bits/bytes long, see tty_subr.c */
int c_cc; /* count of characters in queue */
int c_cn; /* total ring buffer length */
};