Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christian Löpke
bs
Commits
d79358f9
Commit
d79358f9
authored
9 years ago
by
Peter Gerwinski
Browse files
Options
Downloads
Patches
Plain Diff
Notizen zu den Lehrveranstaltungen vom 11. und 18. Mai 2015
parent
a1098446
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
slides/bs-20150511.txt
+58
-0
58 additions, 0 deletions
slides/bs-20150511.txt
slides/bs-20150518.txt
+13
-0
13 additions, 0 deletions
slides/bs-20150518.txt
with
71 additions
and
0 deletions
slides/bs-20150511.txt
0 → 100644
+
58
−
0
View file @
d79358f9
Verzeichnis: Linux-Quelltext
$ find . -name "*syscall*"
$ vi -R ./arch/x86/kernel/syscall_64.c
--> Definition von "sys_call_table" über wiederholte Includes
$ find . -name syscalls_64.h
$ vi -R ./arch/sh/include/asm/syscalls_64.h
$ vi -R ./arch/x86/um/shared/sysdep/syscalls_64.h
--> beides nicht sehr erhellend
$ locate syscalls_64.h
$ vi -R /usr/src/linux-headers-3.16.0-4-amd64/arch/x86/include/generated/asm/syscalls_64.h
$ grep -R syscalls_64\.h *
$ vi -R arch/x86/syscalls/Makefile
$ find . -name syscall_64.tbl
$ vi -R ./arch/x86/syscalls/syscall_64.tbl
--> :-)
$ vi -R ./arch/x86/kernel/syscall_64.c
--> Die 2. Spalte ("sym") bezeichnet den Funktionsnamen.
- Wie findet der "syscall"-Befehl die Tabelle?
- Wo wird die Funktion deklariert?
$ grep -R sys_call_table arch/x86/*
$ vi -R arch/x86/kernel/entry_64.S
--> :-)
$ grep -wr write *
--> :-(
# DuckDuckGo --> http://www.usmanacademy.com/2012/07/linux-system-call-implementation.html
$ find . -name "*write*"
$ vi -R ./fs/read_write.c
--> SYSCALL_DEFINE3(write, ...)
struct fd
vfs_write()
$ vi -R include/linux/file.h
--> struct file *file;
$ grep -r "struct file {" $(find . -name "*.h")
$ vi -R ./include/linux/fs.h
--> const struct file_operations *f_op;
--> ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
--> :-)
$ vi -R ./fs/read_write.c
--> vfs_write():
if (file->f_op->write)
ret = file->f_op->write(file, buf, count, pos);
Beim Öffnen der Datei werden die file_operations in der struct file hinterlegt.
Skript, 11.05.2015, 13:58:25
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- \usepackage{hyperref}
- Daemon schreibt in log-Datei: In welche?
sprintf, 11.05.2015, 14:49:56
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
char buf[42];
sprintf (buf, "%s", "Hello");
sprintf (buf + 5, "%s\n", ", world!");
oder besser:
sprintf (buf + strlen (buf), "%s\n", ", world!");
This diff is collapsed.
Click to expand it.
slides/bs-20150518.txt
0 → 100644
+
13
−
0
View file @
d79358f9
Merlin Klaßen, 18.05.2015, 11:38:37
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
device_write()
cdev_init()
cdev_add()
device_create()
device_destroy()
class_destroy()
cdev_del()
--> Der udev-deamon kümmert sich um das Anlegen und Entfernen der char-Device.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment