Soumettre la recherche
Mettre en ligne
Sysprog 16
•
Télécharger en tant que ODP, PDF
•
1 j'aime
•
1,528 vues
Ahmed Mekkawy
Suivre
Technologie
Signaler
Partager
Signaler
Partager
1 sur 33
Télécharger maintenant
Recommandé
Character drivers
Character drivers
pradeep_tewani
Linux Serial Driver
Linux Serial Driver
艾鍗科技
I2c drivers
I2c drivers
Pradeep Tewani
Linux Timer device driver
Linux Timer device driver
艾鍗科技
Kernel Process Management
Kernel Process Management
pradeep_tewani
Kernel Timing Management
Kernel Timing Management
pradeep_tewani
Linux dma engine
Linux dma engine
pradeep_tewani
Linux PCI device driver
Linux PCI device driver
艾鍗科技
Recommandé
Character drivers
Character drivers
pradeep_tewani
Linux Serial Driver
Linux Serial Driver
艾鍗科技
I2c drivers
I2c drivers
Pradeep Tewani
Linux Timer device driver
Linux Timer device driver
艾鍗科技
Kernel Process Management
Kernel Process Management
pradeep_tewani
Kernel Timing Management
Kernel Timing Management
pradeep_tewani
Linux dma engine
Linux dma engine
pradeep_tewani
Linux PCI device driver
Linux PCI device driver
艾鍗科技
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
Kevin Lo
Audio Drivers
Audio Drivers
Anil Kumar Pugalia
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
RajKumar Rampelli
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
HPC Essentials
HPC Essentials
William Brouwer
Shell Scripting
Shell Scripting
Anil Kumar Pugalia
Threads
Threads
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
Block Drivers
Block Drivers
Anil Kumar Pugalia
Kernel Timing Management
Kernel Timing Management
SysPlay eLearning Academy for You
Challenges in GPU compilers
Challenges in GPU compilers
AnastasiaStulova
Linux Porting
Linux Porting
Champ Yen
Linux Network Management
Linux Network Management
Anil Kumar Pugalia
Synchronization
Synchronization
Anil Kumar Pugalia
Linux Internals Part - 3
Linux Internals Part - 3
SysPlay eLearning Academy for You
gcc and friends
gcc and friends
Anil Kumar Pugalia
Linux DMA Engine
Linux DMA Engine
SysPlay eLearning Academy for You
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
Signals
Signals
Anil Kumar Pugalia
Chapter 3
Chapter 3
lopjuan
Unit 5
Unit 5
siddr
Contenu connexe
Tendances
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
Kevin Lo
Audio Drivers
Audio Drivers
Anil Kumar Pugalia
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
RajKumar Rampelli
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
HPC Essentials
HPC Essentials
William Brouwer
Shell Scripting
Shell Scripting
Anil Kumar Pugalia
Threads
Threads
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
Block Drivers
Block Drivers
Anil Kumar Pugalia
Kernel Timing Management
Kernel Timing Management
SysPlay eLearning Academy for You
Challenges in GPU compilers
Challenges in GPU compilers
AnastasiaStulova
Linux Porting
Linux Porting
Champ Yen
Linux Network Management
Linux Network Management
Anil Kumar Pugalia
Synchronization
Synchronization
Anil Kumar Pugalia
Linux Internals Part - 3
Linux Internals Part - 3
SysPlay eLearning Academy for You
gcc and friends
gcc and friends
Anil Kumar Pugalia
Linux DMA Engine
Linux DMA Engine
SysPlay eLearning Academy for You
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
Signals
Signals
Anil Kumar Pugalia
Tendances
(20)
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
The TCP/IP stack in the FreeBSD kernel COSCUP 2014
Audio Drivers
Audio Drivers
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
Arm device tree and linux device drivers
Arm device tree and linux device drivers
HPC Essentials
HPC Essentials
Shell Scripting
Shell Scripting
Threads
Threads
Network Drivers
Network Drivers
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
Block Drivers
Block Drivers
Kernel Timing Management
Kernel Timing Management
Challenges in GPU compilers
Challenges in GPU compilers
Linux Porting
Linux Porting
Linux Network Management
Linux Network Management
Synchronization
Synchronization
Linux Internals Part - 3
Linux Internals Part - 3
gcc and friends
gcc and friends
Linux DMA Engine
Linux DMA Engine
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
Signals
Signals
En vedette
Chapter 3
Chapter 3
lopjuan
Unit 5
Unit 5
siddr
Unit 7
Unit 7
siddr
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086
techbed
Addressing modes of 8051
Addressing modes of 8051
SARITHA REDDY
Addressing modes
Addressing modes
Mahesh Kumar Attri
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
Saumitra Rukmangad
En vedette
(7)
Chapter 3
Chapter 3
Unit 5
Unit 5
Unit 7
Unit 7
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086
Addressing modes of 8051
Addressing modes of 8051
Addressing modes
Addressing modes
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
Similaire à Sysprog 16
Sysprog17
Sysprog17
Ahmed Mekkawy
Introduction to Kernel Programming
Introduction to Kernel Programming
Ahmed Mekkawy
Confraria Security & IT - Lisbon Set 29, 2011
Confraria Security & IT - Lisbon Set 29, 2011
ricardomcm
C Language Unit-5
C Language Unit-5
kasaragadda srinivasrao
Unit5 (2)
Unit5 (2)
mrecedu
Unit 8
Unit 8
siddr
Unit 3
Unit 3
siddr
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
Linux
Linux
keydak11
Unit5 C
Unit5 C
arnold 7490
Programming in C
Programming in C
sujathavvv
Programming in C
Programming in C
eswarisriram
Unit 6
Unit 6
siddr
Char Drivers And Debugging Techniques
Char Drivers And Debugging Techniques
YourHelper1
slides3_077.ppt
slides3_077.ppt
DEEPAK948083
C for Java programmers (part 1)
C for Java programmers (part 1)
Dmitry Zinoviev
The Rust Programming Language: an Overview
The Rust Programming Language: an Overview
Roberto Casadei
FreeBSD and Drivers
FreeBSD and Drivers
Kernel TLV
Sysprog 11
Sysprog 11
Ahmed Mekkawy
proxyc CSAPP Web proxy NAME IMPORTANT Giv.pdf
proxyc CSAPP Web proxy NAME IMPORTANT Giv.pdf
ajay1317
Similaire à Sysprog 16
(20)
Sysprog17
Sysprog17
Introduction to Kernel Programming
Introduction to Kernel Programming
Confraria Security & IT - Lisbon Set 29, 2011
Confraria Security & IT - Lisbon Set 29, 2011
C Language Unit-5
C Language Unit-5
Unit5 (2)
Unit5 (2)
Unit 8
Unit 8
Unit 3
Unit 3
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Linux
Linux
Unit5 C
Unit5 C
Programming in C
Programming in C
Programming in C
Programming in C
Unit 6
Unit 6
Char Drivers And Debugging Techniques
Char Drivers And Debugging Techniques
slides3_077.ppt
slides3_077.ppt
C for Java programmers (part 1)
C for Java programmers (part 1)
The Rust Programming Language: an Overview
The Rust Programming Language: an Overview
FreeBSD and Drivers
FreeBSD and Drivers
Sysprog 11
Sysprog 11
proxyc CSAPP Web proxy NAME IMPORTANT Giv.pdf
proxyc CSAPP Web proxy NAME IMPORTANT Giv.pdf
Plus de Ahmed Mekkawy
Encrypted Traffic in Egypt - an attempt to understand
Encrypted Traffic in Egypt - an attempt to understand
Ahmed Mekkawy
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Ahmed Mekkawy
OpenData for governments
OpenData for governments
Ahmed Mekkawy
Infrastructure as a Code
Infrastructure as a Code
Ahmed Mekkawy
شركة سبيرولا للأنظمة والجمعية المصرية للمصادر المفتوحة
شركة سبيرولا للأنظمة والجمعية المصرية للمصادر المفتوحة
Ahmed Mekkawy
Everything is a Game
Everything is a Game
Ahmed Mekkawy
Why Cloud Computing has to go the FOSS way
Why Cloud Computing has to go the FOSS way
Ahmed Mekkawy
FOSS Enterpreneurship
FOSS Enterpreneurship
Ahmed Mekkawy
Intro to FOSS & using it in development
Intro to FOSS & using it in development
Ahmed Mekkawy
FOSS, history and philosophy
FOSS, history and philosophy
Ahmed Mekkawy
Virtualization Techniques & Cloud Compting
Virtualization Techniques & Cloud Compting
Ahmed Mekkawy
A look at computer security
A look at computer security
Ahmed Mekkawy
Networking in Gnu/Linux
Networking in Gnu/Linux
Ahmed Mekkawy
Foss Movement In Egypt
Foss Movement In Egypt
Ahmed Mekkawy
Sysprog 15
Sysprog 15
Ahmed Mekkawy
Sysprog 9
Sysprog 9
Ahmed Mekkawy
Sysprog 12
Sysprog 12
Ahmed Mekkawy
Sysprog 14
Sysprog 14
Ahmed Mekkawy
Sysprog 7
Sysprog 7
Ahmed Mekkawy
Sysprog 8
Sysprog 8
Ahmed Mekkawy
Plus de Ahmed Mekkawy
(20)
Encrypted Traffic in Egypt - an attempt to understand
Encrypted Traffic in Egypt - an attempt to understand
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
Securing Governmental Public Services with Free/Open Source Tools - Egyptian ...
OpenData for governments
OpenData for governments
Infrastructure as a Code
Infrastructure as a Code
شركة سبيرولا للأنظمة والجمعية المصرية للمصادر المفتوحة
شركة سبيرولا للأنظمة والجمعية المصرية للمصادر المفتوحة
Everything is a Game
Everything is a Game
Why Cloud Computing has to go the FOSS way
Why Cloud Computing has to go the FOSS way
FOSS Enterpreneurship
FOSS Enterpreneurship
Intro to FOSS & using it in development
Intro to FOSS & using it in development
FOSS, history and philosophy
FOSS, history and philosophy
Virtualization Techniques & Cloud Compting
Virtualization Techniques & Cloud Compting
A look at computer security
A look at computer security
Networking in Gnu/Linux
Networking in Gnu/Linux
Foss Movement In Egypt
Foss Movement In Egypt
Sysprog 15
Sysprog 15
Sysprog 9
Sysprog 9
Sysprog 12
Sysprog 12
Sysprog 14
Sysprog 14
Sysprog 7
Sysprog 7
Sysprog 8
Sysprog 8
Dernier
Architecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
apidays
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
MadyBayot
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Dropbox
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
lior mazor
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
Zilliz
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
apidays
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Edi Saputra
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Rustici Software
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Remote DBA Services
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Juan lago vázquez
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
The Digital Insurer
Dernier
(20)
Architecting Cloud Native Applications
Architecting Cloud Native Applications
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
Sysprog 16
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
int echo_main(int argc,
char **argv) { struct iovec io[argc]; struct iovec *cur_io = io; char *arg; char *p; ... while (1) { int c; cur_io->iov_base = p = arg; ... while ((c = *arg++)) { if (c == eflag) { /* Check for escape seq. */ if (*arg == 'c') { /* '' means cancel newline and ignore all subsequent chars. */ cur_io->iov_len = p - (char*)cur_io->iov_base; cur_io++; goto ret; } ... c = bb_process_escape_sequence( (void*) &arg); } *p++ = c; } arg = *++argv; if (arg) *p++ = ' '; cur_io->iov_len = p - (char*)cur_io->iov_base; cur_io++; if (!arg) break; } ret: return writev(1, io, (cur_io - io)) >= 0; }
15.
16.
17.
18.
#ifdef F_SETLK #ifndef
SEEK_SET #define SEEK_SET 0 #endif struct flock lock_data; lock_data.l_type = F_WRLCK; lock_data.l_whence = SEEK_SET; lock_data.l_start = lock_data.l_len = 0; if (fcntl(pidFd, F_SETLK, &lock_data) == -1) { if (errno == EAGAIN) return oldpid; else return -1; } #else #ifdef LOCK_EX if (flock (pidFd, LOCK_EX|LOCK_NB) == -1) { if (errno == EWOULDBLOCK) return oldpid; else return -1; } #else if (lockf (pidFd, F_TLOCK, 0) == -1) { if (errno == EACCES) return oldpid; else return -1; } #endif #endif }
19.
20.
21.
22.
23.
24.
25.
26.
static pid_list *scan_proc_pids(inode_list
*ilist) { DIR *d; struct dirent *de; pid_t pid; pid_list *plist; xchdir("/proc"); d = opendir("/proc"); if (!d) return NULL; plist = NULL; while ((de = readdir(d)) != NULL) { pid = (pid_t)bb_strtou(de->d_name, NULL, 10); if (errno) continue; if (chdir(de->d_name) < 0) continue; plist = scan_link("cwd", pid, ilist, plist); plist = scan_link("exe", pid, ilist, plist); plist = scan_link("root", pid, ilist, plist); .... } closedir(d); return plist; } static pid_list *scan_link(const char *lname, pid_t pid, inode_list *ilist, pid_list *plist) { ino_t inode; dev_t dev; if (!file_to_dev_inode(lname, &dev, &inode)) return plist; if (search_dev_inode(ilist, dev, inode)) plist = add_pid(plist, pid); return plist; } static int file_to_dev_inode(const char *filename, dev_t *dev, ino_t *inode) { struct stat f_stat; if (stat(filename, &f_stat)) return 0; *inode = f_stat.st_ino; *dev = f_stat.st_dev; return 1; } static int search_dev_inode(inode_list *ilist, dev_t dev, ino_t inode) { while (ilist) { if (ilist->dev == dev) { if (option_mask32 & OPT_MOUNT) return 1; if (ilist->inode == inode) return 1; } ilist = ilist->next; } return 0; }
27.
28.
29.
30.
31.
32.
int inotifyd_main(int argc
UNUSED_PARAM, char **argv) { unsigned mask = IN_ALL_EVENTS; // assume we want all events struct pollfd pfd; char **watched = ++argv; // watched name list const char *args[] = { *argv, NULL, NULL, NULL, NULL }; // open inotify pfd.fd = inotify_init(); if (pfd.fd < 0) bb_perror_msg_and_die("no kernel support"); // setup watched while (*++argv) { char *path = *argv; char *masks = strchr(path, ':'); int wd; // watch descriptor // if mask is specified -> if (masks) { *masks = ''; // split path and mask // convert mask names to mask bitset mask = 0; while (*++masks) { int i = strchr(mask_names, *masks) - mask_names; if (i >= 0) { mask |= (1 << i); } } } // add watch wd = inotify_add_watch(pfd.fd, path, mask); if (wd < 0) { bb_perror_msg_and_die("add watch (%s) failed", path); } } static const char mask_names[] ALIGN1 = "a" // 0x00000001 File was accessed "c" // 0x00000002 File was modified "e" // 0x00000004 Metadata changed "w" // 0x00000008 Writtable file was closed "0" // 0x00000010 Unwrittable file closed "r" // 0x00000020 File was opened "m" // 0x00000040 File was moved from X "y" // 0x00000080 File was moved to Y "n" // 0x00000100 Subfile was created "d" // 0x00000200 Subfile was deleted "D" // 0x00000400 Self was deleted "M" // 0x00000800 Self was moved ; pfd.events = POLLIN; while (!signalled && poll(&pfd, 1, -1) > 0) { ssize_t len; void *buf; struct inotify_event *ie; // read out all pending events xioctl(pfd.fd, FIONREAD, &len); #define eventbuf bb_common_bufsiz1 ie = buf = (len <= sizeof(eventbuf)) ? eventbuf : xmalloc(len); len = full_read(pfd.fd, buf, len); // process events. N.B. events may vary in length while (len > 0) { int i; char events[12]; char *s = events; unsigned m = ie->mask; for (i = 0; i < 12; ++i, m >>= 1) { if (m & 1) { *s++ = mask_names[i]; } } *s = ''; args[1] = events; args[2] = watched[ie->wd]; args[3] = ie->len ? ie->name : NULL; xspawn((char **)args); // next event i = sizeof(struct inotify_event) + ie->len; len -= i; ie = (void*)((char*)ie + i); } if (eventbuf != buf) free(buf); } return EXIT_SUCCESS; }
33.
Télécharger maintenant