-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatvlib.c
More file actions
32 lines (25 loc) · 775 Bytes
/
atvlib.c
File metadata and controls
32 lines (25 loc) · 775 Bytes
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
/*
* Copyright (C) 2025 Sylas Hollander.
* PURPOSE: ATVLib main file.
* SPDX-License-Identifier: MIT
*/
#include <atvlib.h>
mach_boot_args_t *gBA;
boolean_t verbose;
// C entry point for Apple TV code
noreturn void atvlib_init(mach_boot_args_t *ba)
{
gBA = ba;
// Initialize console.
if (!cons_init(&ba->video, COLOR_WHITE, COLOR_BLACK))
halt();
// Enable verbose output.
// This is triggered by adding "-v" or "-x" to the "Kernel Flags" key in com.apple.Boot.plist
// or holding Command-V or Command-S on the keyboard.
verbose = (ba->video.display_mode == DISPLAY_MODE_TEXT);
if (verbose)
cons_clear_screen(COLOR_BLACK);
trace("Hello, world!\n");
fail(__FILE__, __LINE__, "Test");
halt();
}