14 char a[] =
"Greetings from C disk! Parameters:";
15 Byte parameters = 0x80;
16 printf(
"%s\"%s\"\n", a, parameters);
21 file =
open(
"data.txt",
"");
23 puts(
"ERROR file cannot be opened\n");
27 size_t size =
read(disk, 12, file);
28 printf(
"Readed: %iB: ", size);
29 for(
size_t i = 0; i < size; i++)
31 printf(
"\nSize: %i; ID: %i\n", size, file->
id);
33 size =
read(disk, 700, file);
35 puts(
"ERROR file cannot be readed\n");
38 for(
size_t i = 0; i < size; i++)
43 write(
"Hello!!! data.txt, I've overwritten it!", 40, file);
48 for(
int i = 0; i < 16; i++) {
49 for(
int j = 0; j < 16; j++)
50 cputc(
'X', j + i * 16, 2);
60 char L0[8] =
"123456";
61 char L1[] =
"Napis1\n";
65 char test2[] =
"cdYou shouldn't see this";
75 for(
int i = 0; i < 10000; i++) {
82 for(
size_t i = 0; i < SIZE_X; i++) {
89 if(ret < 0)
return ret;
94 printf(
"%i %i %i %i", mouse.x, mouse.y, mouse.status, (Color)color);
96 if(mouse.status == LeftPress) {
100 if(mouse.status == RightPress) {
107 if(key.available == 1) {
115 }
while(key.character !=
'a');
117 setColorPalette(DarkGrey);
121 char b[] =
"DISK 1234567890";
Console input output control.
void cputc(char c, Color color, Byte times)
Color put character.
void setVideoMode(Mode mode)
Set the video mode of screen.
int create(const int filename, size_t size)
Create file.
int write(int buf, size_t size, FILE *stream)
Write to file.
FILE * open(int filename, int mode)
Open file.
int read(int buf, size_t size, FILE *stream)
Read from file.
Draw pixels in graphics mode.
void writePixel(Position pos, Color color)
Draw single pixel.
Standard input output library.
Key getKeyBuff(void)
Get key from buffer.
Key getc(void)
Wait for key in buffer, get it and clear buffer.
void printf(const int str,...)
C-like printf function.
void puts(const int string)
Put string.
void putc(Byte character)
Put character.
Get mouse position and status, to use mouse call mouseInitialize()
int mouseInitialize()
Initialize mouse, by default mouse in enabled.
void udelay(unsigned long usecs)
Delay usecs microseconds.
int strncpy(int destination, int source, size_t num)
Copy num Bytes from source to destination until \0 appears.
char * strcpy(char *destination, const char *source)
Copy from source to destination until \0 appears.
const char * strchr(const char *str, int character)
Find first appearance of character.
#define NULL
pointer to NULL
#define __start
Must be before main function of program to put this function as first in binary file.
Key information, got from buffer.