Commit c808f1c506667c5ffb73c2c41304f635efffa25c

Scheduling changes. Quite broken
  
8181 for(; ;)
8282 {
8383 // This is a test for threading
84 /* textmode::setpos(0);
84 textmode::setpos(0);
8585 cout << "KERNEL!";
8686 scheduler::sleep(1000);
8787 textmode::setpos(0);
8888 cout << " ";
89 scheduler::sleep(1000);*/
89 scheduler::sleep(1000);
9090 }
9191
9292 // If we break the loop for some reason, just shutdown
9595
9696int test_thread(void *)
9797{
98 int i;
9899 for(; ;)
99100 {
100101 textmode::setpos(20);
101 cout << "THREAD!";
102 cout << "THREAD!" << i;
102103 scheduler::sleep(500);
103104 textmode::setpos(20);
104105 cout << " ";
105106 scheduler::sleep(500);
107 i++;
106108 }
109
110 return 0;
107111}
108112
109113namespace kernel
137137 fs_root = initrd::initialise(initrd_address);
138138
139139 // Start multitasking
140 //multitasking::initialise();
140 multitasking::initialise();
141141 }
142142
143143 void start_error()
  
1/*
2 * Symmetry Kernel
3 *
4 * Copyright (c) 2010 Stephen Gentle
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18
119#ifndef RUNTIME_H
220#define RUNTIME_H
321
  
4242 return;
4343 }
4444
45 // Read the esp, ebp registers
46 uintptr esp, ebp;
47
48 esp = regs.esp;
49 ebp = regs.ebp;
50
5145 // Save the registers
5246 current_thread->set_eip(regs.eip);
53 current_thread->set_stack_ptr(esp, ebp);
47 current_thread->set_stack_ptr(regs.esp, regs.ebp);
5448
5549 // TODO: Get next task in vector
5650 if(current_thread == kernel)
5751 {
5852 current_thread = other;
59 other->set_stack_ptr(esp, ebp);
53 other->set_stack_ptr(regs.esp, regs.ebp);
6054 }
6155 else
6256 {
6565 regs.esp = current_thread->get_esp();
6666 regs.ebp = current_thread->get_ebp();
6767
68 current_thread->get_parent()->get_address_space()->switch_to();
68 //current_thread->get_parent()->get_address_space()->switch_to();
6969 }
7070
7171 size_t add_process(process * p)