tasking: switch tss.esp0 on switching process
This commit is contained in:
@@ -92,11 +92,4 @@ struct tss_entry_struct {
|
|||||||
|
|
||||||
extern struct tss_entry_struct tss;
|
extern struct tss_entry_struct tss;
|
||||||
|
|
||||||
struct seg_desc gdt[NR_GDT_ENTRIES];
|
|
||||||
|
|
||||||
struct desc_r gdtr = {
|
|
||||||
sizeof(gdt) - 1,
|
|
||||||
(uint32_t)&gdt
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4,6 +4,13 @@
|
|||||||
|
|
||||||
struct tss_entry_struct tss;
|
struct tss_entry_struct tss;
|
||||||
|
|
||||||
|
struct seg_desc gdt[NR_GDT_ENTRIES];
|
||||||
|
|
||||||
|
struct desc_r gdtr = {
|
||||||
|
sizeof(gdt) - 1,
|
||||||
|
(uint32_t)&gdt
|
||||||
|
};
|
||||||
|
|
||||||
void bss_init()
|
void bss_init()
|
||||||
{
|
{
|
||||||
memset((void *)((int)_edata), 0, KERNEL_BSS_SIZE);
|
memset((void *)((int)_edata), 0, KERNEL_BSS_SIZE);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "../include/paging.h"
|
#include "../include/paging.h"
|
||||||
#include "../include/string.h"
|
#include "../include/string.h"
|
||||||
#include "../include/liballoc.h"
|
#include "../include/liballoc.h"
|
||||||
|
#include "../include/gdt.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
@@ -145,6 +146,7 @@ void schedule() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (next && next != current) {
|
if (next && next != current) {
|
||||||
|
tss.esp0 = next->kesp;
|
||||||
switchProcess(next);
|
switchProcess(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user