Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6527 | serge | 1 | /* |
2 | * This file has no copyright assigned and is placed in the Public Domain. |
||
3 | * This file is a part of the kos32-runtime package. |
||
4 | * No warranty is given; refer to the file DISCLAIMER within the package. |
||
5 | * |
||
6 | * Source code for the startup proceedures used by all programs. This code |
||
7 | * is compiled to make crt1.o, which should be located in the library path. |
||
8 | * |
||
9 | */ |
||
10 | |||
11 | void *load_libc(void); |
||
12 | void* get_entry_point(void *raw); |
||
13 | |||
14 | void __attribute__((noreturn)) |
||
15 | __crt_startup (void) |
||
16 | { |
||
17 | void __attribute__((noreturn)) (*entry)(void *img); |
||
18 | void *img; |
||
19 | |||
20 | img = load_libc(); |
||
21 | |||
22 | if(!img) |
||
23 | { |
||
24 | asm ("int $0x40" ::"a"(-1)); |
||
25 | }; |
||
26 | |||
27 | entry = get_entry_point(img); |
||
28 | entry(img); |
||
29 | } |
||
30 |