Skip to content
Snippets Groups Projects
Commit 7f4d33ad authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

30.3.2020

parent 3919c6ec
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 1948 deletions
File deleted
blink-1.elf: file format elf32-avr
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 34 00 jmp 0x68 ; 0x68 <__ctors_end>
4: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
8: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
10: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
14: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
18: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
1c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
20: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
24: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
28: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
2c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
30: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
34: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
38: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
3c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
40: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
44: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
48: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
4c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
50: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
54: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
58: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
5c: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
60: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
64: 0c 94 3e 00 jmp 0x7c ; 0x7c <__bad_interrupt>
00000068 <__ctors_end>:
68: 11 24 eor r1, r1
6a: 1f be out 0x3f, r1 ; 63
6c: cf ef ldi r28, 0xFF ; 255
6e: d8 e0 ldi r29, 0x08 ; 8
70: de bf out 0x3e, r29 ; 62
72: cd bf out 0x3d, r28 ; 61
74: 0e 94 40 00 call 0x80 ; 0x80 <main>
78: 0c 94 57 00 jmp 0xae ; 0xae <_exit>
0000007c <__bad_interrupt>:
7c: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
00000080 <main>:
80: 81 e0 ldi r24, 0x01 ; 1
82: 8a b9 out 0x0a, r24 ; 10
84: 58 9a sbi 0x0b, 0 ; 11
86: 2f ef ldi r18, 0xFF ; 255
88: 89 e6 ldi r24, 0x69 ; 105
8a: 98 e1 ldi r25, 0x18 ; 24
8c: 21 50 subi r18, 0x01 ; 1
8e: 80 40 sbci r24, 0x00 ; 0
90: 90 40 sbci r25, 0x00 ; 0
92: e1 f7 brne .-8 ; 0x8c <main+0xc>
94: 00 c0 rjmp .+0 ; 0x96 <main+0x16>
96: 00 00 nop
98: 58 98 cbi 0x0b, 0 ; 11
9a: 2f ef ldi r18, 0xFF ; 255
9c: 89 e6 ldi r24, 0x69 ; 105
9e: 98 e1 ldi r25, 0x18 ; 24
a0: 21 50 subi r18, 0x01 ; 1
a2: 80 40 sbci r24, 0x00 ; 0
a4: 90 40 sbci r25, 0x00 ; 0
a6: e1 f7 brne .-8 ; 0xa0 <main+0x20>
a8: 00 c0 rjmp .+0 ; 0xaa <main+0x2a>
aa: 00 00 nop
ac: eb cf rjmp .-42 ; 0x84 <main+0x4>
000000ae <_exit>:
ae: f8 94 cli
000000b0 <__stop_program>:
b0: ff cf rjmp .-2 ; 0xb0 <__stop_program>
File deleted
\documentclass{article}
\input tmp.inputs
\pagestyle{empty}
\begin{document}
\begin{pspicture}(6,2)
\put(3,2){\makebox(0,0)[t]{Harte Echtzeitanforderungen}}
\put(3,0){\makebox(0,0)[b]{Ressourcen optimal nutzen}}
\psline[arrows=<->](3,0.4)(3.2,1.125)(2.8,0.875)(3,1.6)
\end{pspicture}
\end{document}
\documentclass{article}
\input tmp.inputs
\pagestyle{empty}
\begin{document}
\begin{pspicture}(6,2)
\put(3,2){\makebox(0,0)[t]{Harte Echtzeitanforderungen}}
\put(3,0){\makebox(0,0)[b]{Ressourcen optimal nutzen}}
\psline[arrows=<->](3,0.4)(3.2,1.125)(2.8,0.875)(3,1.6)
\end{pspicture}
\end{document}
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
20190329/photo-20190329-134251.jpg

162 KiB

cassini/home/peter/bo/2018ss/bs/20180413> echo -n "Hallo"
Hallocassini/home/peter/bo/2018ss/bs/20180413> ls -l /bin/echo
-rwxr-xr-x 1 root root 31464 Feb 22 2017 /bin/echo
cassini/home/peter/bo/2018ss/bs/20180413> ls -l /bin/ls
-rwxr-xr-x 1 root root 130736 Feb 22 2017 /bin/ls
cassini/home/peter/bo/2018ss/bs/20180413> if [ 2 == 2 ]; then echo "Jau."; else echo "Hä?"; fi
Jau.
cassini/home/peter/bo/2018ss/bs/20180413> if ls /bin/ls; then echo "Jau."; else echo "Hä?"; fi
/bin/ls
Jau.
cassini/home/peter/bo/2018ss/bs/20180413> if ls /bin/prlxprüü; then echo "Jau."; else echo "Hä?"; fi
ls: Zugriff auf '/bin/prlxprüü' nicht möglich: Datei oder Verzeichnis nicht gefunden
Hä?
cassini/home/peter/bo/2018ss/bs/20180413> ls -l /bin/[
ls: Zugriff auf '/bin/[' nicht möglich: Datei oder Verzeichnis nicht gefunden
cassini/home/peter/bo/2018ss/bs/20180413> ls -l /bin/}[
ls: Zugriff auf '/bin/}[' nicht möglich: Datei oder Verzeichnis nicht gefunden
cassini/home/peter/bo/2018ss/bs/20180413> ls -l /bin/\[
ls: Zugriff auf '/bin/[' nicht möglich: Datei oder Verzeichnis nicht gefunden
cassini/home/peter/bo/2018ss/bs/20180413> ls -l /usr/bin/\[
-rwxr-xr-x 1 root root 52008 Feb 22 2017 /usr/bin/[
cassini/home/peter/bo/2018ss/bs/20180413> hallo="Hallo, Welt!"
cassini/home/peter/bo/2018ss/bs/20180413> echo $hallo
Hallo, Welt!
cassini/home/peter/bo/2018ss/bs/20180413> unset hallo
cassini/home/peter/bo/2018ss/bs/20180413> echo $hallo
cassini/home/peter/bo/2018ss/bs/20180413> hallo="Hallo, Welt!"
cassini/home/peter/bo/2018ss/bs/20180413> echo $Hallo
cassini/home/peter/bo/2018ss/bs/20180413> hallo = bla
bash: hallo: Kommando nicht gefunden.
cassini/home/peter/bo/2018ss/bs/20180413> hallo= bla
bash: bla: Kommando nicht gefunden.
cassini/home/peter/bo/2018ss/bs/20180413> hallo=blabla
cassini/home/peter/bo/2018ss/bs/20180413> echo $hallo
blabla
cassini/home/peter/bo/2018ss/bs/20180413> hallo=Hallo, Welt!
bash: Welt!: Kommando nicht gefunden.
cassini/home/peter/bo/2018ss/bs/20180413> if [ 2 -lt 3 ]; then echo "kleiner"; else echo "größer"; fi
kleiner
cassini/home/peter/bo/2018ss/bs/20180413> hallo=Hallo! echo $hallo
blabla
cassini/home/peter/bo/2018ss/bs/20180413/src/test> ls -l ..
insgesamt 12
-rw-r--r-- 1 peter peter 82 Apr 13 14:50 hello-1.c
-rw-r--r-- 1 peter peter 82 Apr 13 14:52 hello-2.c
drwxr-xr-x 2 peter peter 4096 Apr 13 14:50 test
cassini/home/peter/bo/2018ss/bs/20180413/src/test> mv ../hello-*.c
cassini/home/peter/bo/2018ss/bs/20180413/src/test> ls -l
insgesamt 0
cassini/home/peter/bo/2018ss/bs/20180413/src/test> ls -l ..
insgesamt 8
-rw-r--r-- 1 peter peter 82 Apr 13 14:50 hello-2.c
drwxr-xr-x 2 peter peter 4096 Apr 13 14:50 test
This diff is collapsed.
20190405/screen-memory-1.png

199 KiB

Makefile-2
\ No newline at end of file
TARGET = blink-1
$(TARGET).elf: $(TARGET).c
avr-gcc -Wall -Os -c -mmcu=atmega328p $(TARGET).c -o $(TARGET).elf
$(TARGET).hex: $(TARGET).elf
avr-objcopy -O ihex $(TARGET).elf $(TARGET).hex
upload: $(TARGET).hex
avrdude -P /dev/ttyACM0 -c arduino -p m328p -U flash:w:$(TARGET).hex
hello-1: hello-1.c
gcc -Wall -O hello-1.c -o hello-1
obj-m += hellomod-1.o
obj-m += chardev-1.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
/*
* chardev.c: Creates a read-only char device that says how many times
* you've read from the dev file
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <asm/uaccess.h> /* for put_user */
/*
* Prototypes - this would normally go in a .h file
*/
int init_module(void);
void cleanup_module(void);
static int device_open(struct inode *, struct file *);
static int device_release(struct inode *, struct file *);
static ssize_t device_read(struct file *, char *, size_t, loff_t *);
static ssize_t device_write(struct file *, const char *, size_t, loff_t *);
#define SUCCESS 0
#define DEVICE_NAME "chardev" /* Dev name as it appears in /proc/devices */
#define BUF_LEN 80 /* Max length of the message from the device */
/*
* Global variables are declared as static, so are global within the file.
*/
static int Major; /* Major number assigned to our device driver */
static int Device_Open = 0; /* Is device open?
* Used to prevent multiple access to device */
static char msg[BUF_LEN]; /* The msg the device will give when asked */
static char *msg_Ptr;
static struct file_operations fops = {
.read = device_read,
.write = device_write,
.open = device_open,
.release = device_release
};
/*
* This function is called when the module is loaded
*/
int init_module(void)
{
Major = register_chrdev(0, DEVICE_NAME, &fops);
if (Major < 0) {
printk(KERN_ALERT "Registering char device failed with %d\n", Major);
return Major;
}
printk(KERN_INFO "I was assigned major number %d. To talk to\n", Major);
printk(KERN_INFO "the driver, create a dev file with\n");
printk(KERN_INFO "'mknod /dev/%s c %d 0'.\n", DEVICE_NAME, Major);
printk(KERN_INFO "Try various minor numbers. Try to cat and echo to\n");
printk(KERN_INFO "the device file.\n");
printk(KERN_INFO "Remove the device file and module when done.\n");
return SUCCESS;
}
/*
* This function is called when the module is unloaded
*/
void cleanup_module(void)
{
/*
* Unregister the device
*/
unregister_chrdev(Major, DEVICE_NAME);
}
/*
* Methods
*/
/*
* Called when a process tries to open the device file, like
* "cat /dev/mycharfile"
*/
static int device_open(struct inode *inode, struct file *file)
{
static int counter = 0;
if (Device_Open)
return -EBUSY;
Device_Open++;
sprintf(msg, "I already told you %d times Hello world!\n", counter++);
msg_Ptr = msg;
try_module_get(THIS_MODULE);
return SUCCESS;
}
/*
* Called when a process closes the device file.
*/
static int device_release(struct inode *inode, struct file *file)
{
Device_Open--; /* We're now ready for our next caller */
/*
* Decrement the usage count, or else once you opened the file, you'll
* never get get rid of the module.
*/
module_put(THIS_MODULE);
return 0;
}
/*
* Called when a process, which already opened the dev file, attempts to
* read from it.
*/
static ssize_t device_read(struct file *filp, /* see include/linux/fs.h */
char *buffer, /* buffer to fill with data */
size_t length, /* length of the buffer */
loff_t * offset)
{
/*
* Number of bytes actually written to the buffer
*/
int bytes_read = 0;
/*
* If we're at the end of the message,
* return 0 signifying end of file
*/
if (*msg_Ptr == 0)
return 0;
/*
* Actually put the data into the buffer
*/
while (length && *msg_Ptr) {
/*
* The buffer is in the user data segment, not the kernel
* segment so "*" assignment won't work. We have to use
* put_user which copies data from the kernel data segment to
* the user data segment.
*/
put_user(*(msg_Ptr++), buffer++);
length--;
bytes_read++;
}
/*
* Most read functions return the number of bytes put into the buffer
*/
return bytes_read;
}
/*
* Called when a process writes to dev file: echo "hi" > /dev/hello
*/
static ssize_t
device_write(struct file *filp, const char *buff, size_t len, loff_t * off)
{
printk(KERN_ALERT "Sorry, this operation isn't supported.\n");
return -EINVAL;
}
20190412/crash-5.png

171 KiB

20190412/graphic-memory-2.png

2.79 KiB

20190412/graphic-memory-3.png

1.25 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment