main
Simon 4 months ago
parent a0e2a59f96
commit e8ec76112b

@ -18,7 +18,10 @@
#include "arch/context.h"
#include "thread/thread.h"
<<<<<<< HEAD
=======
>>>>>>> 4e7dad9 (fooo)
///TextStream kout = TextStream(0, 80, 0, 10, true);
Ticketlock koutlock;
@ -33,6 +36,12 @@ Ticketlock koutlock;
// TextStream(0 ,0 ,0, 0,false),
//};
Context test1;
uint8_t test1_stack[256];
Application application = Application(test1_stack);
TextStream dout[Core::MAX] = {
{0, 40, 10, 14},
{40, 80, 10, 14},
@ -82,6 +91,8 @@ void test_func2(){
}
}
// Main function
// (the bootstrap processor starts here)}
extern "C" int main() {
@ -107,12 +118,8 @@ extern "C" int main() {
PS2Controller::drainBuffer();
DBG << "Main CPU " << static_cast<int>(LAPIC::getID()) << endl << flush;
prepareContext(test1_stack, test1, (void(*)(void*)) &(Application::kickoff),(Thread*)&application);
Context test1;
Thread test1_thread;
uint8_t test1_stack[256];
prepareContext(&test1_stack[255], test1, (void(*)(void*)) &(Application::kickoff), );
context_launch(&test1);
//Application{}.action();

@ -6,10 +6,14 @@
typedef void (*kickoff_t)(void*);
void Thread::kickoff(Thread* object) {
Guard::leave();
//Guard::leave();
object->action(); }
Thread::Thread(void* tos) { (void)tos; }
Thread::Thread(void* tos) {
volatile bool kill_flag;
Context context;
Thread* queue_link;
}
void Thread::resume(Thread* next) { (void)next; }

@ -42,7 +42,6 @@ class Thread {
public:
/*! \brief Marker for a dying thread
*/
volatile bool kill_flag;
/*! \brief Constructor
* Initializes the context using \ref prepareContext with the given stack

@ -24,7 +24,8 @@ class Application:public Thread {
*
* \todo(14) Implement Constructor
*/
Application(void* tos): Thread(tos){
}
/*! \brief Contains the application code.
*
* \todo(14) Implement Method

Loading…
Cancel
Save