mesa want you to work, so mesa can sleep...

This commit is contained in:
Jonathan Turner 2023-11-29 22:14:09 -05:00
parent 2ffb52ae02
commit 4673d709e1

View File

@ -240,23 +240,57 @@ void begin_output_example() {
static node* holes_head = NULL; static node* holes_head = NULL;
holes_head = get_holes(umem_head); holes_head = get_holes(umem_head);
// Display 1
kprint("Jonathan Turner - S02\n"); kprint("Jonathan Turner - S02\n");
kprint("Current Allocation: \n"); kprint("Current Allocation: \n");
print_memory(umem_head, holes_head); print_memory(umem_head, holes_head);
umem_head = add_node( umem_head, 0x10000, 0x3FF, true, global_id++); umem_head = add_node( umem_head, 0x10000, 0x3FF, true, 0);
umem_head = add_node( umem_head, 0x11000, 0x1FF, true, global_id++); umem_head = add_node( umem_head, 0x11000, 0x1FF, true, 1);
umem_head = add_node( umem_head, 0x12000, 0x3FF, true, global_id++); umem_head = add_node( umem_head, 0x12000, 0x3FF, true, 2);
umem_head = add_node( umem_head, 0x15000, 0x7FF, true, global_id++); umem_head = add_node( umem_head, 0x15000, 0x7FF, true, 3);
umem_head = add_node( umem_head, 0x22000, 0x1FFF, true, global_id++); umem_head = add_node( umem_head, 0x22000, 0x1FFF, true, 4);
// Display 2
print_memory(umem_head, holes_head); print_memory(umem_head, holes_head);
node* temp = umem_head->next; node* temp = umem_head->next;
free_node(umem_head); free_node(umem_head);
umem_head = temp; umem_head = temp;
umem_head->previous = NULL; umem_head->previous = NULL;
print_memory(umem_head, holes_head); print_memory(umem_head, holes_head);
print_list(umem_head);
print_list(get_holes(umem_head));
// Display 3
temp = get_tail(umem_head); temp = get_tail(umem_head);
temp->previous = NULL;
free_node(temp); free_node(temp);
print_memory(umem_head, holes_head); print_memory(umem_head, holes_head);
print_list(umem_head);
print_list(get_holes(umem_head));
// Display 4
umem_head = add_node( umem_head, 0x23000, 0x1FFF, true, 5);
umem_head = add_node( umem_head, 0x25000, 0x3FFF, true, 6);
print_memory(umem_head, holes_head);
print_list(umem_head);
print_list(get_holes(umem_head));
// Display 5
temp = find_id(4);
node* previous = temp->previous;
previous->next = temp->next;
free_node(temp);
print_memory(umem_head, holes_head);
print_list(umem_head);
print_list(get_holes(umem_head));
// Display 6
while (umem_head != NULL) {
temp = umem_head->next;
free_node(umem_head);
umem_head = temp;
}
print_memory(umem_head, holes_head);
print_list(umem_head);
print_list(get_holes(umem_head));
kprint("Jonathan Turner - S02");
} }