diff --git a/pb_utils/README.md b/pb_utils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..eb5f75153bd9abdf1d6b5f371d2d75d900e5052d --- /dev/null +++ b/pb_utils/README.md @@ -0,0 +1,41 @@ +# dependencies +- build is tested on a ubuntu +- for qemu minimum needed: `sudo apt install qemu qemu-system-x86` + +# build +## create an image file with a debian rootfs (only needed first time) + +run `./create_image.sh`, this downloads dbootstrap and installs a debian into a image file + +## chroot into debian rootfs to build the kernel +(build on your system is possible, but for example ubuntu 20.04 libs throw exceptions) + +run `./chroot_image.sh`, this drops you in a shell on the created debian + +to build: +```bash +apt update +apt-get install -y fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison +cd /mnt +./build +``` + +# run the build kernel with the created rootfs +run `./run_qemu.sh` + +# debug using gdb +run `./run_qemu.sh gdb` + +run in a seperate shell: +```bash +cd .. # to workspace root + +gdb vmlinux \ + -ex 'lx-symbols' \ + -ex 'target remote :1234' \ + -ex 'hb init_pb_rq' +``` + +look for gdb `add-auto-load-safe-path` warning and follow instruction to enable loading of kernel gdb scripts + +use hardware breakpoints instead of software breaks diff --git a/pb_utils/pb_submitter/README.md b/pb_utils/pb_submitter/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d46863863e78cf0d854dfd9ea948c418059f9e85 --- /dev/null +++ b/pb_utils/pb_submitter/README.md @@ -0,0 +1,5 @@ +# build +run `./build.sh`, this will compile `pb_submitter.c` and `test_prog.c` and move them combined with `example_plan` and `example_run.sh` into the qemu-image which should be located at `../build/qemu-image.img`. + +# run +Afterwards simply execute `./run_qemu.sh` in the parent directory followed by `./example_run.sh` in the debian VM to submit the `example_plan` for the `test_prog` to the PBS. \ No newline at end of file diff --git a/pb_utils/pb_submitter/pb_submitter.c b/pb_utils/pb_submitter/pb_submitter.c index 023146b98c0c307188e74592f2fe89aadbe892f6..5524f6678bf540ed5ed2a4e943ede02280793493 100644 --- a/pb_utils/pb_submitter/pb_submitter.c +++ b/pb_utils/pb_submitter/pb_submitter.c @@ -63,8 +63,6 @@ int main(int argc, char** argv) plan.num_tasks = count_lines(fp); - printf("num_tasks: %zu \n", plan.num_tasks); - uint64_t* inst_cnt = calloc(plan.num_tasks, sizeof(uint64_t)); if (inst_cnt == NULL) { perror("calloc"); @@ -91,8 +89,6 @@ int main(int argc, char** argv) plan.inst_cnt = inst_cnt; - printf("Execve: %s \n", argv[1]); - pid_t pid = fork(); if (pid == 0x0) {