aboutsummaryrefslogtreecommitdiff
path: root/kernel/boot/gdt/gdt.s
blob: d1d768ce74f3960285a7a6816f99af72eb6263ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.global _GDT_flush
.type _GDT_flush, @function
_GDT_flush:
  /* First Argument (Pointer to the GDT) */
  movl 4(%esp), %eax
  
  /* Load GDT */
  lgdt (%eax)

  /* Offset For Kernel Data Segment (16 bits) */
  mov $0x10, %eax

  /* Set the Data Segment Selectors */
  mov %ax, %ds
  mov %ax, %es
  mov %ax, %fs
  mov %ax, %gs
  mov %ax, %ss

  /* Set the Code Segment Selector */
  jmp $0x08, $.flush

.flush:
  ret