main
Simon 4 months ago
parent a0e2a59f96
commit e8ec76112b

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

@ -6,10 +6,14 @@
typedef void (*kickoff_t)(void*); typedef void (*kickoff_t)(void*);
void Thread::kickoff(Thread* object) { void Thread::kickoff(Thread* object) {
Guard::leave(); //Guard::leave();
object->action(); } 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; } void Thread::resume(Thread* next) { (void)next; }

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

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

Loading…
Cancel
Save