Check-in [b3b5eb5f08]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:bugs fixed
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | descriptor
Files: files | file ages | folders
SHA1:b3b5eb5f0814915b1549e0658a4d6b03b0b1119e
User & Date: Alisad 2018-11-12 19:04:19
Context
2018-11-13
06:32
merged trunk into descriptor check-in: 0a2b15c728 user: maxi tags: descriptor
2018-11-12
19:04
bugs fixed check-in: b3b5eb5f08 user: Alisad tags: descriptor
17:38
idt, some bugs fixed check-in: ca04ca826c user: Alisad tags: descriptor
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to include/memory/gdt.h.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include "libk/memory.h"
#include "libk/string.h"
#include "memory/lma_allocator.h"

namespace Paging
{

namespace __GDT
{

struct GDT_ENTRY
{
	private: uint8_t _Table[8];

	public:
................................................................................

GDT_ENTRY construct_tss(uint32_t base, uint32_t limit, uint8_t flags, uint8_t dpl, bool present, bool bussy);
GDT_ENTRY construct_dpl();
GDT_ENTRY construct_ldt();
GDT_ENTRY construct_empty_descriptor();
GDT_ENTRY construct_gdt_entry(uint32_t base, uint32_t limit, uint8_t flags, uint8_t access_byte);

}  // namespace __GDT
class gdt_wrapper
{
	__GDT::GDT *table;
	bool is_loaded;

	size_t prealloc = 0;
	size_t cont = 0;

	void realloc ();

  public:
	gdt_wrapper();
	void load_gdt();
	void save_gdt();
	__GDT::GDT_ENTRY *add_entry(__GDT::GDT_ENTRY entry);
	__GDT::GDT_ENTRY *get_entry(int index);
	gdt_wrapper &operator<<(__GDT::GDT_ENTRY entry);
	__GDT::gdt_iterator begin();
	__GDT::gdt_iterator begin() const;

	__GDT::gdt_iterator end();
	__GDT::gdt_iterator end() const;
};


} // namespace Paging






|







 







|


|











|
|
|
|
|

|
|




6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include "libk/memory.h"
#include "libk/string.h"
#include "memory/lma_allocator.h"

namespace Paging
{

namespace GDT
{

struct GDT_ENTRY
{
	private: uint8_t _Table[8];

	public:
................................................................................

GDT_ENTRY construct_tss(uint32_t base, uint32_t limit, uint8_t flags, uint8_t dpl, bool present, bool bussy);
GDT_ENTRY construct_dpl();
GDT_ENTRY construct_ldt();
GDT_ENTRY construct_empty_descriptor();
GDT_ENTRY construct_gdt_entry(uint32_t base, uint32_t limit, uint8_t flags, uint8_t access_byte);

}  // namespace GDT
class gdt_wrapper
{
	GDT::GDT *table;
	bool is_loaded;

	size_t prealloc = 0;
	size_t cont = 0;

	void realloc ();

  public:
	gdt_wrapper();
	void load_gdt();
	void save_gdt();
	GDT::GDT_ENTRY *add_entry(GDT::GDT_ENTRY entry);
	GDT::GDT_ENTRY *get_entry(int index);
	gdt_wrapper &operator<<(GDT::GDT_ENTRY entry);
	GDT::gdt_iterator begin();
	GDT::gdt_iterator begin() const;

	GDT::gdt_iterator end();
	GDT::gdt_iterator end() const;
};


} // namespace Paging

Changes to include/memory/idt.h.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "libk/memory.h"
#include "libk/string.h"
#include "memory/lma_allocator.h"

namespace Paging
{

namespace __IDT
{

struct IDT_ENTRY
{
	private: uint8_t _Table[8];

	public:
................................................................................
};

IDT_ENTRY construct_empty_descriptor();
IDT_ENTRY construct_trap_gate(uint16_t selector, uint32_t offset, uint8_t dpl, bool present, bool sizeofgate);
IDT_ENTRY construct_interrupt_gate(uint16_t selector, uint32_t offset, uint8_t dpl, bool present, bool sizeofgate);
IDT_ENTRY construct_task_gate(uint16_t selector, uint8_t dpl, bool present);

}  // namespace __IDT
class idt_wrapper
{
	__IDT::IDT *table;
	bool is_loaded;

	size_t prealloc = 0;
	size_t cont = 0;

	void realloc ();

  public:
	idt_wrapper();
	void load_idt();
	void save_idt();
	__IDT::IDT_ENTRY *add_entry(__IDT::IDT_ENTRY entry);
	__IDT::IDT_ENTRY *get_entry(int index);
	idt_wrapper &operator<<(__IDT::IDT_ENTRY entry);
	__IDT::idt_iterator begin();
	__IDT::idt_iterator begin() const;

	__IDT::idt_iterator end();
	__IDT::idt_iterator end() const;
};


} // namespace Paging






|







 







|


|











|
|
|
|
|

|
|




6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "libk/memory.h"
#include "libk/string.h"
#include "memory/lma_allocator.h"

namespace Paging
{

namespace IDT
{

struct IDT_ENTRY
{
	private: uint8_t _Table[8];

	public:
................................................................................
};

IDT_ENTRY construct_empty_descriptor();
IDT_ENTRY construct_trap_gate(uint16_t selector, uint32_t offset, uint8_t dpl, bool present, bool sizeofgate);
IDT_ENTRY construct_interrupt_gate(uint16_t selector, uint32_t offset, uint8_t dpl, bool present, bool sizeofgate);
IDT_ENTRY construct_task_gate(uint16_t selector, uint8_t dpl, bool present);

}  // namespace IDT
class idt_wrapper
{
	IDT::IDT *table;
	bool is_loaded;

	size_t prealloc = 0;
	size_t cont = 0;

	void realloc ();

  public:
	idt_wrapper();
	void load_idt();
	void save_idt();
	IDT::IDT_ENTRY *add_entry(IDT::IDT_ENTRY entry);
	IDT::IDT_ENTRY *get_entry(int index);
	idt_wrapper &operator<<(IDT::IDT_ENTRY entry);
	IDT::idt_iterator begin();
	IDT::idt_iterator begin() const;

	IDT::idt_iterator end();
	IDT::idt_iterator end() const;
};


} // namespace Paging

Changes to src/memory/gdt.cpp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
...
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#include "memory/gdt.h"
#include <termutils/terminal.h>

namespace Paging
{

namespace __GDT
{

uint32_t GDT_ENTRY::getbase()
{
	return (static_cast<uint32_t>(_Table[2])) + (static_cast<uint32_t>(_Table[3]) << 8)
		+ (static_cast<uint32_t>(_Table[4]) << 16) + (static_cast<uint32_t>(_Table[7]) << 24);
}
................................................................................
	return tmp;
}

GDT_ENTRY construct_empty_descriptor()
{
	return construct_gdt_entry(0, 0, 0, 0);
}
} // namespace __GDT

gdt_wrapper::gdt_wrapper()
{
	table = reinterpret_cast<__GDT::GDT *>(Physical::LMA::allocate(sizeof(__GDT::GDT)));
	*table = __GDT::GDT();

	table->entries = reinterpret_cast<__GDT::GDT_ENTRY *>(Physical::LMA::allocate(0 * sizeof(__GDT::GDT_ENTRY)));
	table->size = 0;
	table->offset = reinterpret_cast<uint32_t>((&table->entries));

	add_entry(__GDT::construct_empty_descriptor());
	table->size--;
}
void gdt_wrapper::realloc()
{
	prealloc += 16;
	void *new_space = Physical::LMA::allocate((sizeof(__GDT::GDT_ENTRY) * prealloc));
	memcpy(table->entries, new_space, cont * sizeof (__GDT::GDT_ENTRY));
	for (size_t i = 0; i < prealloc; i++)
	{
		delete &table->entries[i];
	}
	table->entries = reinterpret_cast<__GDT::GDT_ENTRY *>(new_space);
	table->offset = reinterpret_cast<uint32_t>(&table->entries) + 6;
}
void gdt_wrapper::load_gdt()
{
	lgdt(table);
}
void gdt_wrapper::save_gdt()
................................................................................
	uint16_t *p;
	sgdt(p);

	uint16_t _limit = p[0];
	uint32_t _base = p[1];

	uint64_t *tmp = reinterpret_cast<uint64_t *>(_base);
	__GDT::GDT_ENTRY tmpg;
	for (size_t index = 1; index < _limit/8; index++)
	{
		tmpg.setl(tmp[index]);
		if (cont > index)
			table->entries[index] = tmpg;
		else
			add_entry(tmpg);
	}
}
__GDT::GDT_ENTRY *gdt_wrapper::add_entry(__GDT::GDT_ENTRY entry)
{
	if (cont == prealloc)
		realloc();

	table->entries[cont] = entry;
	cont++;
	table->size += 8;
	return &table->entries[cont - 1];
}

__GDT::GDT_ENTRY *gdt_wrapper::get_entry(int index)
{
	return &table->entries[index];
}

gdt_wrapper& gdt_wrapper::operator<< (__GDT::GDT_ENTRY entry) {
	add_entry (entry); return *this;
}
__GDT::gdt_iterator gdt_wrapper::begin () {
	return __GDT::gdt_iterator (&table->entries [0], 0, cont);
}

__GDT::gdt_iterator gdt_wrapper::begin () const {
	return __GDT::gdt_iterator (&table->entries [0], 0, cont);
}
__GDT::gdt_iterator gdt_wrapper::end () {
	return __GDT::gdt_iterator (&table->entries [cont], cont, cont);
}
__GDT::gdt_iterator gdt_wrapper::end () const {
	return __GDT::gdt_iterator (&table->entries [cont], cont, cont);
}
} // namespace INT





|







 







|



|
|

|



|





|
|




|







 







|









|










|




|


|
|


|
|

|
|

|
|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
...
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#include "memory/gdt.h"
#include <termutils/terminal.h>

namespace Paging
{

namespace GDT
{

uint32_t GDT_ENTRY::getbase()
{
	return (static_cast<uint32_t>(_Table[2])) + (static_cast<uint32_t>(_Table[3]) << 8)
		+ (static_cast<uint32_t>(_Table[4]) << 16) + (static_cast<uint32_t>(_Table[7]) << 24);
}
................................................................................
	return tmp;
}

GDT_ENTRY construct_empty_descriptor()
{
	return construct_gdt_entry(0, 0, 0, 0);
}
} // namespace GDT

gdt_wrapper::gdt_wrapper()
{
	table = reinterpret_cast<GDT::GDT *>(Physical::LMA::allocate(sizeof(GDT::GDT)));
	*table = GDT::GDT();

	table->entries = reinterpret_cast<GDT::GDT_ENTRY *>(Physical::LMA::allocate(0 * sizeof(GDT::GDT_ENTRY)));
	table->size = 0;
	table->offset = reinterpret_cast<uint32_t>((&table->entries));

	add_entry(GDT::construct_empty_descriptor());
	table->size--;
}
void gdt_wrapper::realloc()
{
	prealloc += 16;
	void *new_space = Physical::LMA::allocate((sizeof(GDT::GDT_ENTRY) * prealloc));
	memcpy(table->entries, new_space, cont * sizeof (GDT::GDT_ENTRY));
	for (size_t i = 0; i < prealloc; i++)
	{
		delete &table->entries[i];
	}
	table->entries = reinterpret_cast<GDT::GDT_ENTRY *>(new_space);
	table->offset = reinterpret_cast<uint32_t>(&table->entries) + 6;
}
void gdt_wrapper::load_gdt()
{
	lgdt(table);
}
void gdt_wrapper::save_gdt()
................................................................................
	uint16_t *p;
	sgdt(p);

	uint16_t _limit = p[0];
	uint32_t _base = p[1];

	uint64_t *tmp = reinterpret_cast<uint64_t *>(_base);
	GDT::GDT_ENTRY tmpg;
	for (size_t index = 1; index < _limit/8; index++)
	{
		tmpg.setl(tmp[index]);
		if (cont > index)
			table->entries[index] = tmpg;
		else
			add_entry(tmpg);
	}
}
GDT::GDT_ENTRY *gdt_wrapper::add_entry(GDT::GDT_ENTRY entry)
{
	if (cont == prealloc)
		realloc();

	table->entries[cont] = entry;
	cont++;
	table->size += 8;
	return &table->entries[cont - 1];
}

GDT::GDT_ENTRY *gdt_wrapper::get_entry(int index)
{
	return &table->entries[index];
}

gdt_wrapper& gdt_wrapper::operator<< (GDT::GDT_ENTRY entry) {
	add_entry (entry); return *this;
}
GDT::gdt_iterator gdt_wrapper::begin () {
	return GDT::gdt_iterator (&table->entries [0], 0, cont);
}

GDT::gdt_iterator gdt_wrapper::begin () const {
	return GDT::gdt_iterator (&table->entries [0], 0, cont);
}
GDT::gdt_iterator gdt_wrapper::end () {
	return GDT::gdt_iterator (&table->entries [cont], cont, cont);
}
GDT::gdt_iterator gdt_wrapper::end () const {
	return GDT::gdt_iterator (&table->entries [cont], cont, cont);
}
} // namespace INT

Changes to src/memory/idt.cpp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#include "memory/idt.h"
#include <termutils/terminal.h>

namespace Paging
{

namespace __IDT
{

uint32_t IDT_ENTRY::getoffset()
{
	return (static_cast<uint32_t>(_Table[1])) + (static_cast<uint32_t>(_Table[0]) << 8)
		+ (static_cast<uint32_t>(_Table[7]) << 16) + (static_cast<uint32_t>(_Table[6]) << 24);
}
................................................................................
{
	IDT_ENTRY tmp;

	tmp.setl(0x0000000000000000);

	return tmp;
}
} // namespace __IDT

idt_wrapper::idt_wrapper()
{
	table = (__IDT::IDT *) Physical::LMA::allocate(sizeof(__IDT::IDT));
	*table = __IDT::IDT();

	table->entries = reinterpret_cast<__IDT::IDT_ENTRY *>(Physical::LMA::allocate(0 * sizeof(__IDT::IDT_ENTRY)));
	table->size = 0;
	table->offset = reinterpret_cast<uint32_t>((&table->entries));

	add_entry(__IDT::construct_empty_descriptor());
	table->size--;
}
void idt_wrapper::realloc()
{
	prealloc += 16;
	void *new_space = Physical::LMA::allocate((sizeof(__IDT::IDT_ENTRY) * prealloc));
	memcpy(table->entries, new_space, cont * sizeof (__IDT::IDT_ENTRY));
	for (size_t i = 0; i < prealloc; i++)
	{
		delete &table->entries[i];
	}
	table->entries = reinterpret_cast<__IDT::IDT_ENTRY *>(new_space);
	table->offset = reinterpret_cast<uint32_t>((&table->entries)) + 6;
}
void idt_wrapper::load_idt()
{
	lidt(table);
}
void idt_wrapper::save_idt()
................................................................................
	uint16_t *p;
	sidt(p);

	uint16_t _limit = p[0];
	uint32_t _base = p[1];

	uint64_t *tmp = reinterpret_cast<uint64_t *>(_base);
	__IDT::IDT_ENTRY tmpg;
	for (size_t index = 1; index < _limit/8; index++)
	{
		tmpg.setl(tmp[index]);
		if (cont > index)
			table->entries[index] = tmpg;
		else
			add_entry(tmpg);
	}
}
__IDT::IDT_ENTRY *idt_wrapper::add_entry(__IDT::IDT_ENTRY entry)
{
	if (cont == prealloc)
		realloc();

	table->entries[cont] = entry;
	cont++;
	table->size += 8;
	return &table->entries[cont - 1];
}

__IDT::IDT_ENTRY *idt_wrapper::get_entry(int index)
{
	return &table->entries[index];
}

idt_wrapper& idt_wrapper::operator<< (__IDT::IDT_ENTRY entry) {
	add_entry (entry);
	return *this;
}
__IDT::idt_iterator idt_wrapper::begin () {
	return __IDT::idt_iterator (&table->entries [0], 0, cont);
}

__IDT::idt_iterator idt_wrapper::begin () const {
	return __IDT::idt_iterator (&table->entries [0], 0, cont);
}
__IDT::idt_iterator idt_wrapper::end () {
	return __IDT::idt_iterator (&table->entries [cont], cont, cont);
}
__IDT::idt_iterator idt_wrapper::end () const {
	return __IDT::idt_iterator (&table->entries [cont], cont, cont);
}
} // namespace INT





|







 







|



|
|

|



|





|
|




|







 







|









|










|




|



|
|


|
|

|
|

|
|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#include "memory/idt.h"
#include <termutils/terminal.h>

namespace Paging
{

namespace IDT
{

uint32_t IDT_ENTRY::getoffset()
{
	return (static_cast<uint32_t>(_Table[1])) + (static_cast<uint32_t>(_Table[0]) << 8)
		+ (static_cast<uint32_t>(_Table[7]) << 16) + (static_cast<uint32_t>(_Table[6]) << 24);
}
................................................................................
{
	IDT_ENTRY tmp;

	tmp.setl(0x0000000000000000);

	return tmp;
}
} // namespace IDT

idt_wrapper::idt_wrapper()
{
	table = (IDT::IDT *) Physical::LMA::allocate(sizeof(IDT::IDT));
	*table = IDT::IDT();

	table->entries = reinterpret_cast<IDT::IDT_ENTRY *>(Physical::LMA::allocate(0 * sizeof(IDT::IDT_ENTRY)));
	table->size = 0;
	table->offset = reinterpret_cast<uint32_t>((&table->entries));

	add_entry(IDT::construct_empty_descriptor());
	table->size--;
}
void idt_wrapper::realloc()
{
	prealloc += 16;
	void *new_space = Physical::LMA::allocate((sizeof(IDT::IDT_ENTRY) * prealloc));
	memcpy(table->entries, new_space, cont * sizeof (IDT::IDT_ENTRY));
	for (size_t i = 0; i < prealloc; i++)
	{
		delete &table->entries[i];
	}
	table->entries = reinterpret_cast<IDT::IDT_ENTRY *>(new_space);
	table->offset = reinterpret_cast<uint32_t>((&table->entries)) + 6;
}
void idt_wrapper::load_idt()
{
	lidt(table);
}
void idt_wrapper::save_idt()
................................................................................
	uint16_t *p;
	sidt(p);

	uint16_t _limit = p[0];
	uint32_t _base = p[1];

	uint64_t *tmp = reinterpret_cast<uint64_t *>(_base);
	IDT::IDT_ENTRY tmpg;
	for (size_t index = 1; index < _limit/8; index++)
	{
		tmpg.setl(tmp[index]);
		if (cont > index)
			table->entries[index] = tmpg;
		else
			add_entry(tmpg);
	}
}
IDT::IDT_ENTRY *idt_wrapper::add_entry(IDT::IDT_ENTRY entry)
{
	if (cont == prealloc)
		realloc();

	table->entries[cont] = entry;
	cont++;
	table->size += 8;
	return &table->entries[cont - 1];
}

IDT::IDT_ENTRY *idt_wrapper::get_entry(int index)
{
	return &table->entries[index];
}

idt_wrapper& idt_wrapper::operator<< (IDT::IDT_ENTRY entry) {
	add_entry (entry);
	return *this;
}
IDT::idt_iterator idt_wrapper::begin () {
	return IDT::idt_iterator (&table->entries [0], 0, cont);
}

IDT::idt_iterator idt_wrapper::begin () const {
	return IDT::idt_iterator (&table->entries [0], 0, cont);
}
IDT::idt_iterator idt_wrapper::end () {
	return IDT::idt_iterator (&table->entries [cont], cont, cont);
}
IDT::idt_iterator idt_wrapper::end () const {
	return IDT::idt_iterator (&table->entries [cont], cont, cont);
}
} // namespace INT

Changes to src/tests/gdt_test.cpp.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
bool gdt_test()
{
	Termutils::cout << "session: \n";
	Paging::gdt_wrapper *g1;
	g1 = reinterpret_cast<Paging::gdt_wrapper *>(Paging::Physical::LMA::allocate(sizeof(Paging::gdt_wrapper)));
	*g1 = Paging::gdt_wrapper();
	g1->save_gdt();
	g1->add_entry(Paging::__GDT::construct_gdt_entry(0x12345678,0xabcd, 0x90, 0x92));
	g1->load_gdt();

	Paging::idt_wrapper *g2;
	g2 = reinterpret_cast<Paging::idt_wrapper *>(Paging::Physical::LMA::allocate(sizeof(Paging::idt_wrapper)));
	*g2 = Paging::idt_wrapper();
	g2->add_entry(Paging::__IDT::construct_trap_gate(0xaaaa, 0xbbbbbbbb, 0x00, 1, 1));
	g2->load_idt();
	return true;
}
} // namespace TH






|





|




8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
bool gdt_test()
{
	Termutils::cout << "session: \n";
	Paging::gdt_wrapper *g1;
	g1 = reinterpret_cast<Paging::gdt_wrapper *>(Paging::Physical::LMA::allocate(sizeof(Paging::gdt_wrapper)));
	*g1 = Paging::gdt_wrapper();
	g1->save_gdt();
	g1->add_entry(Paging::GDT::construct_gdt_entry(0x12345678,0xabcd, 0x90, 0x92));
	g1->load_gdt();

	Paging::idt_wrapper *g2;
	g2 = reinterpret_cast<Paging::idt_wrapper *>(Paging::Physical::LMA::allocate(sizeof(Paging::idt_wrapper)));
	*g2 = Paging::idt_wrapper();
	g2->add_entry(Paging::IDT::construct_trap_gate(0xaaaa, 0xbbbbbbbb, 0x00, 1, 1));
	g2->load_idt();
	return true;
}
} // namespace TH