blob: 4e663f4f1f73b05834a5b79bfeb4611f57bb1e48 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#include <stdint.h>
#include <stddef.h>
#include <stdarg.h>
#include <uchar.h>
#define nelem(arr) (sizeof(arr)/sizeof(*(arr)))
struct framebuffer
{
void *addr;
uint64_t width;
uint64_t height;
uint64_t pitch;
};
struct memmap
{
uintptr_t start;
uint64_t size;
};
struct boot_info
{
struct framebuffer framebuffer;
uint64_t memmap_count;
struct memmap *memmaps;
};
/* boot.c */
uint64_t cpu_count(void);
/* main.c */
void main(struct boot_info *);
#define ASSERT(chk) do{if(!(chk)) halt();}while(0)
/* screen.c */
void screen_init(struct framebuffer *);
void screen_draw_pixel(uint32_t, uint32_t, uint32_t);
void print(char8_t *, ...);
/* font.c */
void font_init(void);
void font_draw(char8_t *, uint32_t, uint32_t, uint32_t, uint32_t);
/* util.c */
uint16_t read_uint16_le(const uint8_t *);
uint16_t read_uint16_be(const uint8_t *);
uint32_t read_uint32_le(const uint8_t *);
int memcmp(const void *, const void *, size_t);
/* utf8.c */
int utf8_char_length(const char8_t *);
int utf8_cmp_n(const char8_t *, const char8_t *, uint64_t);
uint32_t utf8_value(const char8_t *);
/* nasty.S */
extern void halt(void);
|