Compare commits

..

No commits in common. "dev" and "Denys-2024-06-04" have entirely different histories.

21 changed files with 7748 additions and 154 deletions

View File

@ -1,6 +1,6 @@
{ {
"user": "borysr", "user": "Denys",
"email": "borysr@gmail.com", "email": "denys@mpabi.pl",
"remotes": [ "remotes": [
{ {
"name": "r", "name": "r",
@ -8,7 +8,7 @@
"domain": "qstack.pl", "domain": "qstack.pl",
"port": "3000", "port": "3000",
"token_name": "t", "token_name": "t",
"token": "8ee3f1b7980197aeceadee3cf4d980f817d44f06", "token": "a12b9583297c6bce982d9894a48714c7c2b9f73d",
"group": "1i-2023", "group": "1i-2023",
"project": "homework" "project": "homework"
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

256
cpp/.gdb_history Normal file
View File

@ -0,0 +1,256 @@
c
b main
c
c
exit
target extended-remote localhost:3333
file prog
load
dashboard memory watch 0x1ff80 0x80
set radix 16
set args 0x1ff80 0x80 0x30
source gdb/z.py
source gdb/z.py
source gdb/z.py
source gdb/z.py
source gdb/z.py
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
si
load
si
si
si
si
si
si
si
si
exit

View File

@ -7,7 +7,7 @@ LDLIBS=
CFLAGS+=-O0 -ggdb3 CFLAGS+=-O0 -ggdb3
LDFLAGS+=-Wl,--no-relax LDFLAGS+=-Wl,--no-relax
LDFLAGS+=-Wl,-Ttext=0x80000000,-Tdata=0x80010000 LDFLAGS+=-Wl,-Tdata=0x10000
# LDFLAGS+=-T murax_128k_ram.ld # LDFLAGS+=-T murax_128k_ram.ld
PROGS=prog prog.bin prog.lst PROGS=prog prog.bin prog.lst

View File

@ -9,8 +9,8 @@ _start:
la gp, __global_pointer$ la gp, __global_pointer$
.option pop .option pop
li sp, 0x800ffff0 li sp, 0x1fff0
j finish_bss
# Clear the bss segment # Clear the bss segment
la a0, __bss_start la a0, __bss_start
la a1, __BSS_END__ la a1, __BSS_END__

BIN
cpp/_crt0.o Normal file

Binary file not shown.

View File

@ -1,163 +1,44 @@
#include <stdint.h> #include <stdint.h>
int strlen(char *s) {
char *p = s; int strlen(const char *s) {
while (*p != '\0') const char *p = s;
while (*p != '\0') {
p++; p++;
}
return p - s; return p - s;
} }
void strcpy(char *s, char *t) void strcpy(char *s, const char *t) {
{ while ((*s++ = *t++) != '\0');
while (*s++ = *t++);
} }
#define ALLOCSIZE 10000 #define ALLOCSIZE 10000
static char allocbuf[ALLOCSIZE]; static char allocbuf[ALLOCSIZE];
static char *allocp = allocbuf; static char *allocp = allocbuf;
char *alloc(int n)
{
char *alloc(int n) {
if (n % 4 != 0) { if (n % 4 != 0) {
n += 4 - (n % 4); n += 4 - (n % 4);
} }
if (allocbuf + ALLOCSIZE - allocp >= n) { if (allocbuf + ALLOCSIZE - allocp >= n) {
allocp += n; allocp += n;
return allocp - n; return allocp - n;
} else } else {
return 0; return 0;
}
// def. model danych
//pre processor
#define LEN (8+2)*10
struct model {
char * str;
uint32_t len ;
};
//alg
// prosta implementacji func. z bibl. std. strok przy uzyciu gpt3.5
//
#define NULL ((void*) 0)
//
// Funkcja pomocnicza do sprawdzania, czy znak jest wśród delimiterów
bool is_delim(char c, const char *delims) {
while (*delims) {
if (c == *delims) {
return true;
} }
delims++;
}
return false;
}
// Najprostsza implementacja funkcji strtok
char *simple_strtok(char *str, const char *delims) {
static char *static_str = (char *) NULL; // Przechowuje wskaźnik do bieżącej pozycji w ciągu
// Jeśli przekazano nowy ciąg, zaktualizuj static_str
if (str == NULL) {
return (char *) NULL; // str nie wskazuje na zdanie !!!
}
static_str = str;
// " .,mpabi"
// ^
// Pomiń początkowe delimitery
while (*static_str && is_delim(*static_str, delims)) {
static_str++;
}
// Jeśli doszliśmy do końca ciągu, zwróć NULL
if (*static_str == '\0') {
return (char *) NULL;
}
// Zapisz początek tokenu
char *token_start = static_str;
// Znajdź koniec tokenu
while (*static_str && !is_delim(*static_str, delims)) {
static_str++;
}
// Jeśli znaleziono delimitery, zamień je na '\0' i zaktualizuj static_str
if (*static_str) {
*static_str = '\0';
static_str++;
}
// Zwróć początek tokenu
return token_start;
}
char buf[100];
struct model * p = (struct model *) buf; //p[1]
////func alg
//in: ptr to date
//return: count of words
int alg (const char * ptr) {
char bufer[ALLOCSIZE];
strcpy(bufer, (char *)ptr);
const char *delims = " ,.!?:;\n\t";
int8_t count = 0;
char *token = simple_strtok(bufer, delims);
while (token != (char *)NULL) {
p[count].str = token;
p[count].len = strlen(token);
token = simple_strtok((char *)NULL, delims);
count++;
}
return count;
} }
int main() { int main() {
const char *s = "Denys";
int wynik = strlen(s);
char *str = "If wantered relation no surprise of all";
alg(str); return wynik;
asm ("nop");
return 1;
} }
// wynik tego kodu:
// p[0].str = If
// p[0].len = 2
// p[1].str = wantered
// p[1].len = 8
// p[2].str = relation
// p[2].len = 8
// p[3].str = no
// p[3].len = 2
// p[4].str = surprise
// p[4].len = 8
// p[5].str = of
// p[5].len = 2
// p[6].str = all
// p[6].len = 3

BIN
cpp/_rvmain.o Normal file

Binary file not shown.

17
cpp/gdb/z.py Normal file
View File

@ -0,0 +1,17 @@
# set args 0x1FF80 0x80 0x30
# source gdb/z.py
import gdb
import sys
# Parse arguments from the GDB command
args = gdb.string_to_argv(gdb.parameter("args"))
if len(args) != 3:
print("Usage: source gdb/zero_with_params.py <start_address> <num_bytes> <pattern>")
else:
start_address = int(args[0], 16) # Convert start address from hex to int
num_bytes = int(args[1], 16) # Convert number of bytes from hex to int
pattern = int(args[2], 16) # Convert pattern from hex to int
for i in range(num_bytes):
gdb.execute("set *((char*)%x + %x) = %x" % (start_address, i, pattern))

5
cpp/gdb/zero.py Normal file
View File

@ -0,0 +1,5 @@
#source gdb/z.py
import gdb
for i in range(0, 128): # 128 bajtów
gdb.execute("set *((char*)(0x1FF80 + %x)) = 0xaa" % i)

BIN
cpp/myfunc.o Normal file

Binary file not shown.

BIN
cpp/prog Executable file

Binary file not shown.

BIN
cpp/prog.bin Executable file

Binary file not shown.

7420
cpp/prog.lst Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
https://www.mediafire.com/file/c5d9ad65bxiln6o/MojaGra1.zip/file

View File

@ -6,15 +6,15 @@ import os
from datetime import datetime from datetime import datetime
DEFAULT_CONFIG = { DEFAULT_CONFIG = {
"user": "borysr", "user": "Denys",
"email": "borysr@gmail.com", "email": "denys@mpabi.pl",
"remotes": [{ "remotes": [{
"name": "r", # Zaktualizowano z "default" na "mpabi" "name": "r", # Zaktualizowano z "default" na "mpabi"
"protocol": "http", "protocol": "http",
"domain": "qstack.pl", "domain": "qstack.pl",
"port": "3000", "port": "3000",
"token_name": "t", "token_name": "t",
"token": "8ee3f1b7980197aeceadee3cf4d980f817d44f06", "token": "a12b9583297c6bce982d9894a48714c7c2b9f73d",
"group": "1i-2023", "group": "1i-2023",
"project": "homework" "project": "homework"
}] }]

BIN
robi/IMG_2856.mp4 Normal file

Binary file not shown.

17
start_services.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# Tworzenie nowej sesji tmux o nazwie 'my_session' i wykonywanie poleceń w niej
tmux new-session -d -s dockerr
# Wykonywanie poleceń w pierwszym oknie sesji
tmux send-keys -t dockerr "cd _srvc/devops/cluster/user" C-m
tmux send-keys -t dockerr "docker-compose up" C-m
sleep 5 # Oczekiwanie na uruchomienie kontenerów
# Tworzenie nowego okna w tej samej sesji i wejście do kontenera z uruchomieniem tmux
tmux new-window -t dockerr
tmux send-keys -t dockerr:1 "docker exec -it user_py1_1 bash -c 'tmux new-session -d -s my_container_session && tmux split-window -h && tmux split-window -v && tmux select-pane -t 0 && tmux split-window -v && tmux select-pane -t 0 && tmux send-keys -t 0 \"cd work/cpp && vim\" C-m && tmux send-keys -t 1 \"cd work/cpp/cpp && make clean && make\" C-m && tmux send-keys -t 2 \"cd riscv/VexRiscv/src/test/cpp/murax && make run\" C-m && tmux send-keys -t 3 \"cd riscv/openocd_riscv && . ./__\" C-m && tmux attach-session -d -t my_container_session'" C-m
# Przełączanie na nowe okno i wejście w interaktywny tryb tmux
tmux select-window -t dockerr:1
tmux attach-session -t dockerr