I tried to maintain history of commands in xv6 which can be accessed using up and down arrow keys. I tried to maintain a history of 16 commands at time. I tried to start implementing it by starting from console.c but ended up getting confused. How should I do this ?