CustomBootloader/main.c
2022-02-27 20:03:19 +01:00

19 lines
822 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

void mainentry() {
int x = 5;
char* video_memory = (char*) 0xb8000;
*video_memory = 'X';
// Here , the star following the type means that this is not a variable to hold
// a char (i.e. a single byte ) but a pointer to the ADDRESS of a char ,
// which , being an address , will actually require the allocation of at least
// 32 bits .
char * video_address = (char*)(0xb8000);
// If we d like to store a character at the address pointed to , we make the
// assignment with a star - prefixed pointer variable . This is known as
// dereferencing a pointer , because we are not changing the address held by
// the pointer variable but the contents of that address .
*video_address = 'x';
// Just to emphasise the purpose of the star , an ommision of it , such as:
}