Search code examples
operating-systemkernelpintos

PintOS user program does not print


Im trying to follow this guide, the section about user programs. Apparently, Im able to succesfully pass a program from ubuntu to the Pintos filesystem, because I can see the file by running pintos -q ls

Output of pintos -q ls

When runnning this:

pintos-mkdisk filesys.dsk --filesys-size=2
pintos -f -q
pintos -p ../../examples/echo -a echo -- -q
pintos -q run 'echo x'

I only get this, and no printing:

Running the echo program inside pintos

Any idea of why not seeing the output? I've also tried with the "hellopintos" file, which is simply a hello world like this:

#include <stdio.h>
#include <syscall.h>

    void main(){
       printf("Hello pintos\n");

    }

Solution

  • The issue was that the syscall handler was not implemented on userprog/syscall.c After implementing it and handling the write/print case, the issue was resolved.