Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Mesaglio <[email protected]>
  • Loading branch information
mesaglio committed Jul 8, 2024
0 parents commit b1d37a7
Show file tree
Hide file tree
Showing 36 changed files with 977 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# A.L.GO - Pruebas preliminares y finales

Dentro de este repositorio encontraran scripts que por el momento les van a servir para ver que su TP va funcionando.

Los scripts deben estar correctamente redactados, cualquier consulta o inconveniente con los mismos por favor crear un issue en el [foro](https://faq.utnso.com.ar/foro)

[Documento de Pruebas Preliminares](https://faq.utnso.com.ar/tp-c-comenta-pruebas)

> Los resultados seran los mismos que en la implementacion de C
Los `scripts_kernel` tienen valores default en algunas vairables de entorno:

- KERNEL_HOST => localhost
- KERNEL_PORT => 8080

Para cambiar el valor puede definir una variable en la terminal y volver a correr el script. Pueden hacerlo con algo [como](https://medium.com/@aviator2012/how-to-set-env-variables-on-our-local-terminal-63bb3165606b), `export KERNEL_HOST=192.168.1.10`.
10 changes: 10 additions & 0 deletions preliminares/script_io_basico_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SET AX 1
SET BX 1
SET CX 1
SET DX 1
IO_GEN_SLEEP Interfaz1 10
SET EAX 1
SET EBX 1
SET ECX 1
SET EDX 1
EXIT
17 changes: 17 additions & 0 deletions preliminares/script_io_basico_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SET AX 1
IO_GEN_SLEEP Interfaz1 1
SET BX 1
IO_GEN_SLEEP Interfaz1 1
SET CX 1
IO_GEN_SLEEP Interfaz1 1
SET DX 1
IO_GEN_SLEEP Interfaz1 1
SUM AX BX
IO_GEN_SLEEP Interfaz1 1
SUM BX CX
IO_GEN_SLEEP Interfaz1 1
SUM CX DX
IO_GEN_SLEEP Interfaz1 1
SUM DX AX
IO_GEN_SLEEP Interfaz1 1
EXIT
15 changes: 15 additions & 0 deletions preliminares/script_io_basico_3
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SET AX 1
SET BX 1
SUM AX BX
IO_GEN_SLEEP Interfaz1 10
SET EAX 14554560
SET EBX 11598720
SET ECX 417574
SET EDX 450746
SUM EDX EAX
SUM EDX EBX
SUM EDX ECX
IO_GEN_SLEEP Interfaz2 5
SUM AX BX
SUB AX BX
EXIT
4 changes: 4 additions & 0 deletions preliminares/script_solo_cpu_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SET AX 1
SET BX 1
SUM AX BX
EXIT
11 changes: 11 additions & 0 deletions preliminares/script_solo_cpu_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SET AX 1
SET BX 1
SET CX 1
SET DX 1
SET EAX 1000
SET EBX 1000
SET ECX 1000
SET EDX 1000
SET SI 0
SET DI 64
EXIT
6 changes: 6 additions & 0 deletions preliminares/script_solo_cpu_3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SET AX 1
SET BX 1
SET CX 1
SET DX 1
SET PC 0
EXIT
7 changes: 7 additions & 0 deletions preliminares/script_solo_cpu_4
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SET EAX 0
SET EBX 1
SET ECX 14554560
SUM EAX EBX
SUB ECX EBX
JNZ EAX 0
EXIT
41 changes: 41 additions & 0 deletions scripts_kernel/PRUEBA_DEADLOCK.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

if [ -z "$KERNEL_PORT" ]; then
echo "The KERNEL_PORT is not set"
echo "Using default port 8080"
KERNEL_PORT=8080
fi

if [ -z "$KERNEL_HOST" ]; then
echo "The KERNEL_HOST is not set"
echo "Using default host localhost"
KERNEL_HOST=localhost
fi

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 1,
"path": "/scripts_memoria/LOCK_A"
}'

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 2,
"path": "/scripts_memoria/LOCK_B"
}'

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 3,
"path": "/scripts_memoria/LOCK_C"
}'

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 4,
"path": "/scripts_memoria/LOCK_D"
}'
34 changes: 34 additions & 0 deletions scripts_kernel/PRUEBA_IO.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

if [ -z "$KERNEL_PORT" ]; then
echo "The KERNEL_PORT is not set"
echo "Using default port 8080"
KERNEL_PORT=8080
fi

if [ -z "$KERNEL_HOST" ]; then
echo "The KERNEL_HOST is not set"
echo "Using default host localhost"
KERNEL_HOST=localhost
fi

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 1,
"path": "/scripts_memoria/IO_A"
}'

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 2,
"path": "/scripts_memoria/IO_B"
}'

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 3,
"path": "/scripts_memoria/IO_C"
}'
41 changes: 41 additions & 0 deletions scripts_kernel/PRUEBA_PLANI.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

if [ -z "$KERNEL_PORT" ]; then
echo "The KERNEL_PORT is not set"
echo "Using default port 8080"
KERNEL_PORT=8080
fi

if [ -z "$KERNEL_HOST" ]; then
echo "The KERNEL_HOST is not set"
echo "Using default host localhost"
KERNEL_HOST=localhost
fi

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 1,
"path": "/scripts_memoria/PLANI_1"
}'

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 2,
"path": "/scripts_memoria/PLANI_2"
}'

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 3,
"path": "/scripts_memoria/PLANI_3"
}'

curl --location --request PUT 'http://$KERNEL_HOST:$KERNEL_PORT/process' \
--header 'Content-Type: application/json' \
--data '{
"pid": 4,
"path": "/scripts_memoria/PLANI_4"
}'
Loading

0 comments on commit b1d37a7

Please sign in to comment.