title: Dynamic memory allocation in XV6 kernel
body: <p>I want to implement a <code>Queue</code> struct (using <code>Node</code> struct, similiral to the <code>C</code> code <a href="https://www.geeksforgeeks.org/queue-linked-list-implementation/" rel="nofollow noreferrer">here</a>) in files <code>Queue.c</code> and <code>Queue.h</code> in order to store processes in <code>proc.c</code> in <code>XV6</code> kernel.</p>
  
  <p>I don't know how to to do it, since it requires to use <code>malloc</code>, but I can't use it inside methods which I call from the kernel.</p>
  
  <p>What can I use instead, in order to implement and use the <code>Queue</code>?</p>