aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/modules/hello.c
blob: d1054a1f9e05b0a7292fe298b310d47dbd9edb1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * The first prototype of an ELF module, inspired from the Linux kernel
 * module system.
 */

#include <stdio.h>
#include <sys/module.h>


static int hello_init(void) {
	printf("Hello, world, from 0x%08X!\n", (unsigned int)&hello_init);
	return 0;
}

static void hello_exit(void) {
	printf("Good bye, cruel world!\n");
}

MODULE_INIT(hello_init);
MODULE_EXIT(hello_exit);