51 lines
1.2 KiB
D
51 lines
1.2 KiB
D
/**
|
|
* HULK, the HOS Ultra Light Kernel.
|
|
*/
|
|
module hulk.hulk;
|
|
|
|
import hulk.header;
|
|
import hulk.bootinfo;
|
|
import hulk.framebuffer;
|
|
import hos.memory;
|
|
import ldc.attributes;
|
|
import hulk.kfont;
|
|
|
|
private __gshared Framebuffer fb;
|
|
|
|
extern extern(C) __gshared ubyte _hulk_total_size;
|
|
|
|
@(ldc.attributes.section(".hulk_header"))
|
|
private __gshared Header hulk_header = {
|
|
&_hulk_total_size,
|
|
&hulk_start,
|
|
};
|
|
|
|
/**
|
|
* HULK entry point.
|
|
*
|
|
* @param bootinfo Pointer to HULK boot information structure.
|
|
*/
|
|
extern(C) void hulk_start(ulong rdi, ulong rsi, ulong rdx, BootInfo * bootinfo)
|
|
{
|
|
fb.initialize(bootinfo.fb.buffer, bootinfo.fb.width, bootinfo.fb.height, bootinfo.fb.stride);
|
|
fb.clear(0xFF8800u);
|
|
|
|
for (size_t y = 100u; y < 120u; y++)
|
|
{
|
|
memset32(&bootinfo.fb.buffer[y * bootinfo.fb.stride + 20u], 0x001199u, 20u);
|
|
}
|
|
|
|
string message = "Hello, world! 0123456789!@#$%^&*()_-=+[]{};:\"'<>,./";
|
|
int x = 100u;
|
|
foreach (ch; message)
|
|
{
|
|
const(CharInfo) * ci = &kfont.chars[ch];
|
|
fb.blit_alpha_bitmap(x + ci.left, 100 + ci.top - ci.height, ci.bitmap, ci.width, ci.height, 0x0088CCu);
|
|
x += kfont.advance;
|
|
}
|
|
|
|
for (;;)
|
|
{
|
|
}
|
|
}
|