OrdoFlammae / littleosbook

Source for the little book about OS development
http://ordoflammae.github.io/littleosbook
76 stars 14 forks source link

Section 5.3: Order of fields in gdt struct should be switched #15

Closed aritra0227 closed 1 year ago

aritra0227 commented 1 year ago

According to the oswiki link: https://wiki.osdev.org/GDT, the size takes up the lower 16 bits. Hence the gdt struct definition on section 5.3 should be the following instead:

struct gdt
{
    unsigned short size;
    unsigned int start_address;
} __attribute__((packed));
OrdoFlammae commented 1 year ago

Fixed in commit b6f9a9659654a9b29b6637c8cb140a836ab29d3f.