L0 & WTF can someone help me?
Posted: Wed Jan 11, 2012 6:42 pm
Hi, I'm Sod. 19 and have been programming for various consoles (TI83+, GBA, PSP, PC) for almost 10 years
(I know some may say WTF or yeah right but lets just say I'm a bit of an enthusiast and leave it at that)
My first language was z80 assembly with which and I have prior experience developing os's and shells for
the TI83+. Programming-wise, I'm fluent in z80 assembly, x86 assembly, C, C++, and Python. General-wise,
I'm also fluent in HTML, Javascript, GML (Game Maker Language, for those who don't know, it's much like
Javascript), DOS, and TI-Basic. My weakpoints (languages I know a little bit about by having made an
attempt to learn and either quit or have yet to master) include Java, Bash, Makefile scripts (really need to
learn this...), and C#. Hardware experience, I built my first pc from scrap when I was 8 and know the
names and purposes of everything, however I admit complete ignorance of circuitry. Personal life? None.
PC = Windows 7 and the sun since...god I can't remember when.
Hobbies: Watching / reading Naruto, Bleach, Death Note, and FullMetal Alchemist; 3d modelling (Blender
fanatic ^_^), game making (usually written in C using OpenGL or in Javascript with Unity), Youtube
surfing, watching House and the Big Bang Theory, and degrading the director of Two and a Half men for
killing Charlie Sheen.
Anyway, I started a project about 2 months ago and here my basic setup:I chose this setup with the idea that (when installed to the hd) stage 2 would search a specific directory
for real mode modules that would be executed before switching to protected mode. But back to the issue,
I've read over every bit of documentation I could find and compared my source code with John S. Fine's
bootloader and the MenuetOS kernel and can't figure out why the following code refuses to work:
I feel like an idiot getting stuck at something like this, but I don't know what else to do. I know that
it's not my kernel or stage 1 of the loader, they've both been tested without any problems.
I don't want to use GRUB becauseAdditionally, can someone explain to me the purpose and how to use the TSS descriptor? The only
info about it on the entire osdev wiki is: and
How in the hell am I supposed to know where to place it or how big it should be from these vague
details? And what is "LTR"?
Sorry if I'm coming off as rude, I'm just frustrated that I haven't gotten anywhere in 2 months.
I'm figuratively hemorrhaging! Thanks ahead of time
(I know some may say WTF or yeah right but lets just say I'm a bit of an enthusiast and leave it at that)
My first language was z80 assembly with which and I have prior experience developing os's and shells for
the TI83+. Programming-wise, I'm fluent in z80 assembly, x86 assembly, C, C++, and Python. General-wise,
I'm also fluent in HTML, Javascript, GML (Game Maker Language, for those who don't know, it's much like
Javascript), DOS, and TI-Basic. My weakpoints (languages I know a little bit about by having made an
attempt to learn and either quit or have yet to master) include Java, Bash, Makefile scripts (really need to
learn this...), and C#. Hardware experience, I built my first pc from scrap when I was 8 and know the
names and purposes of everything, however I admit complete ignorance of circuitry. Personal life? None.
PC = Windows 7 and the sun since...god I can't remember when.
Hobbies: Watching / reading Naruto, Bleach, Death Note, and FullMetal Alchemist; 3d modelling (Blender
fanatic ^_^), game making (usually written in C using OpenGL or in Javascript with Unity), Youtube
surfing, watching House and the Big Bang Theory, and degrading the director of Two and a Half men for
killing Charlie Sheen.
Anyway, I started a project about 2 months ago and here my basic setup:
Code: Select all
- 2 stage floppy bootloader
- Stage 1 copies stage 2 (BOOTF2.BIN) to 0x7E00 and KERNEL.BIN to 0x100000 (0x1000:0x0000)
- Stage 2 enables the a20 line and graphics mode and is 'supposed' to setup the GDT and paging
before jumping to the kernel
for real mode modules that would be executed before switching to protected mode. But back to the issue,
I've read over every bit of documentation I could find and compared my source code with John S. Fine's
bootloader and the MenuetOS kernel and can't figure out why the following code refuses to work:
Code: Select all
setupGDT:
cli
cld
lgdt [cs:gdt]
mov eax, cr0
or eax, 0x00000001
mov cr0, eax
jmp $+2
mov ax, 10h
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
; I've also tried setting esp here,
; but no cookie
jmp pword 8:0x100000 ; have also tried 0x10000 and jumping
; to a label directly after, all fail
gdt: dw gdt_end-$-1
dd gdt
dw 0
.kcode: dw 0xFFFF, 0x0000
db 0x00, 0x9A, 0xCF, 0x00
.kdata: dw 0xFFFF, 0x0000
db 0x00, 0x92, 0xCF, 0x00
gdt_end equ $
it's not my kernel or stage 1 of the loader, they've both been tested without any problems.
I don't want to use GRUB because
Code: Select all
1. I don't want menus and crap at startup. I want my os to selected the
best configuration at boot and hide the confusing crap
2. In case I develop something that's worth something, I don't want to get
get caught in legal crap
3. I don't plan on my os being open-source.
4. I just don't want to use GRUB. It makes me think of bugs...and I don't
like bugs...
info about it on the entire osdev wiki is:
Code: Select all
"A TSS segment descriptor (trust me, keep a place for at least one)"
Code: Select all
"GDT[3] = {.base=&myTss, .limit=sizeof(myTss), .type=0x89}; // You can use LTR(0x18)"
details? And what is "LTR"?
Sorry if I'm coming off as rude, I'm just frustrated that I haven't gotten anywhere in 2 months.
I'm figuratively hemorrhaging! Thanks ahead of time