davidcallanan / os-series

818 stars 119 forks source link

set xy funcion #4

Closed ajh123 closed 3 years ago

ajh123 commented 3 years ago

in print.c we can do

void print_set_x_y(size_t Lcol , size_t Lrow){
    col = Lcol;
    row = Lrow;
}

and in our print.h

void print_set_x_y(size_t col , size_t row);

Now in kernel main.c

    print_set_x_y(10,10);
    print_str("Hello, world?");

this will put " Hello, world? " at 10 10

davidcallanan commented 3 years ago

That is a nice feature, I'll consider adding it in a future tutorial. However, I'd like to keep the print functions platform-agnostic, and this function wouldn't work consistently with different numbers of rows and columns.