Getting Started
This is documentation for creating software for the Atom operating system. here the main functions and how to use them and data structures are described
Contribute
Clone a ready-made template in C/C++ from github or write your own. Then clone the AtomSDK repository into your project.
Syscalls
void print(const char* text);
void print_char(char* text, uint8_t color);
void print_hex(const char* text);
void print_dec(uint32_t text);
void print_newline();
void remove_char();
void clear_screen();
void getch(char* input);
void set_color(unsigned char fore_col, unsigned char back_col);
int get_color();
void find_root(inode_t* root);
void find_dir(char* name, inode_t node, inode_t* dir);
void vfs_get_abs_dir(inode_t node, char* out);
void create_file(const char* name, inode_t node, inode_t* file);
void write(inode_t file, void* buffer, uint64_t size);
void read(inode_t file, void* out_buffer, uint64_t size);
void free(uint32_t address);
void vfs_close(inode_t node);
void thread_exit(uint32_t ret_code);
void kernel_info();
void fs_tree();
void thread_show_info();
void thread_create_console();
void create_window(vec2* size, vec2* pos, char* name, window_t** window);
void create_button(vec2* size, vec2* pos, char* name, dobject_t* parent, button_t** button);
void bind_button(button_t** button, uint32_t func, void** param_pointer);
func(param_pointer)
void create_text(vec2* pos, color_t* fg_color, char* _text, dobject_t* parent, text_t** text);
void play(const char* path);
Structs
vec2 - used to store position
typedef struct position {
int x;
int y;
} vec2;
dobject_t
typedef struct _dobject {
uint8_t* name;
uint32_t type;
bool visible;
vec2 size;
vec2 pos;
color_t bg_color;
color_t fg_color;
struct _dobject* parent;
struct _dobject* child;
struct _dobject* next;
// virtual functions
void (*onMouseEvent)(struct _dobject* object, vec2 mouse_hit, uint8_t flags, int x, int y);
void* internalData_onButtonCallback;
} dobject_t;
window_t
typedef struct _window {
dobject_t dobject;
char* name;
bool active;
} window_t;
text_t
typedef struct _text {
dobject_t dobject;
} text_t;
typedef struct _button {
dobject_t dobject;
bool active;
void (*onButtonDown)();
} button_t;