Subversion Repositories HelenOS

Rev

Rev 3425 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3425 Rev 4377
Line 46... Line 46...
46
#include <fibril.h>
46
#include <fibril.h>
47
#include <io/stream.h>
47
#include <io/stream.h>
48
#include <ipc/ipc.h>
48
#include <ipc/ipc.h>
49
#include <async.h>
49
#include <async.h>
50
#include <as.h>
50
#include <as.h>
-
 
51
#include <console.h>
51
#include <loader/pcb.h>
52
#include <loader/pcb.h>
52
 
53
 
53
extern char _heap;
54
extern char _heap;
54
extern int main(int argc, char *argv[]);
55
extern int main(int argc, char *argv[]);
55
 
56
 
-
 
57
int _errno;
-
 
58
 
56
void _exit(int status)
59
void _exit(int status)
57
{
60
{
58
    thread_exit(status);
61
    thread_exit(status);
59
}
62
}
60
 
63
 
Line 67... Line 70...
67
    (void) as_area_create(&_heap, 1, AS_AREA_WRITE | AS_AREA_READ);
70
    (void) as_area_create(&_heap, 1, AS_AREA_WRITE | AS_AREA_READ);
68
    _async_init();
71
    _async_init();
69
    f = fibril_setup();
72
    f = fibril_setup();
70
    __tcb_set(f->tcb);
73
    __tcb_set(f->tcb);
71
   
74
   
72
    open_console();
-
 
73
 
-
 
74
    /* Save the PCB pointer */
75
    /* Save the PCB pointer */
75
    __pcb = (pcb_t *)pcb_ptr;
76
    __pcb = (pcb_t *)pcb_ptr;
76
 
77
 
77
    if (__pcb == NULL) {
78
    if (__pcb == NULL) {
78
        argc = 0;
79
        argc = 0;
Line 81... Line 82...
81
        argc = __pcb->argc;
82
        argc = __pcb->argc;
82
        argv = __pcb->argv;
83
        argv = __pcb->argv;
83
    }
84
    }
84
 
85
 
85
    main(argc, argv);
86
    main(argc, argv);
-
 
87
    console_flush();
86
}
88
}
87
 
89
 
88
void __exit(void)
90
void __exit(void)
89
{
91
{
90
    fibril_teardown(__tcb_get()->fibril_data);
92
    fibril_teardown(__tcb_get()->fibril_data);