Author Topic: Joe's Files  (Read 4155 times)

0 Members and 1 Guest are viewing this topic.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10324
  • In Soviet Russia, text read you!
    • View Profile
    • William's Blog
Joe's Files
« on: September 09, 2005, 08:01:39 PM »
If I used a reference, I added a comment in the file.
There is no license on these files. I asume nobody here would go off and rip my work. Use them to learn, or to debug.

http://www.javaop.com/~joe/OSDEV/bootloader.asm
x86 ASM Bootloader
Untested
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7507
  • One for a Dime two for a Quarter!
    • View Profile
Re: Joe's Files
« Reply #1 on: October 01, 2005, 12:30:30 PM »
Sorry for my late reply, try incrementing a value to test how many times it fails and after so many times it just won't work. No use being stuck in an infinate loop if it's a bad floppy, right?
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10324
  • In Soviet Russia, text read you!
    • View Profile
    • William's Blog
Re: Joe's Files
« Reply #2 on: October 01, 2005, 06:19:05 PM »
I sort of lost interest again =p
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4550
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: Joe's Files
« Reply #3 on: October 03, 2005, 12:27:46 PM »
Code: [Select]
  JMP 0x2000:0x0000           ; Jump to the kernel
RET
Warning: unreachable code detected.

Why have a ret instruction that can never be reached?  And what exactly would you be ret'ting from anyway?
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7507
  • One for a Dime two for a Quarter!
    • View Profile
Re: Joe's Files
« Reply #4 on: October 03, 2005, 03:36:28 PM »
The chaos that is to come if Joe continues in OSDev :P!
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10324
  • In Soviet Russia, text read you!
    • View Profile
    • William's Blog
Re: Joe's Files
« Reply #5 on: October 03, 2005, 05:59:11 PM »
oh noez~
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10324
  • In Soviet Russia, text read you!
    • View Profile
    • William's Blog
Re: Joe's Files
« Reply #6 on: February 12, 2006, 02:37:11 PM »
Heh, I'm starting to actually understand how this stuff all works. This look better?

Code: [Select]
; x86 Assembly Bootloader
; Author: William LaFrance

[BITS 16]
[ORG  0x7C00]
 
MOV BX,  0x2000              ; Segment location to read to
MOV ES,      BX              ; Segment location to read to (moves from temporary location)
MOV BX,  0x0000              ; Offset to read into
MOV AH,  0x0002              ; BIOS read sector function
MOV AL,  0x0001              ; Number of sectors to read
MOV CH,  0x0001              ; Track to read from
MOV CL,  0x0002              ; Sector to read from
MOV DH,  0x0001              ; Head to read from
MOV DL,  0x0000              ; Drive to read from
XOR EAX, EAX

.READ
INC EAX
CMP EAX, 3  ;If EAX = 3
JE .FAIL    ;Goto .FAIL
INT 0x0013
JC .READ
JMP 0x2000:0x0000

.FAIL
; I don't know, we do something really bad though!


TIMES 510-($-$$)    DB 0      ; Fills unused sector space with 0s
                    DW 0xAA55 ; Adds the bootloader signature to the ending
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7507
  • One for a Dime two for a Quarter!
    • View Profile
Re: Joe's Files
« Reply #7 on: February 12, 2006, 04:54:52 PM »
Why are you messing with Realmode segments? Unless of course you'd like to reset them in your second stage.

Try setting up a stack then pushing/popping registers to save thier state and regain the original values you set in the beginning.
It also doesn't make much sense to use 'EAX' in a 16bit enviroment.
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10324
  • In Soviet Russia, text read you!
    • View Profile
    • William's Blog
Re: Joe's Files
« Reply #8 on: February 13, 2006, 06:10:19 AM »
What's a realmode segment?
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7507
  • One for a Dime two for a Quarter!
    • View Profile
Re: Joe's Files
« Reply #9 on: February 13, 2006, 06:31:31 AM »
Segment registers ES,DS,FS,GS,SS, CS, etc..
They matter in realmode.

In protected mode you have the option of them not mattering (or seeming not to) by using 'Flat Model'
what you do is in your GDT (Global Descriptor Table) you set the base to 0 and limit to 0xFFFFFFFF which effectively
removes segmentation. Then you create a code and data kernel descriptor, set the DS regulary and do a far jump to set CS.

Google some tutorials on RealMode most good ones explain segments. Or even intro to protected mode tutorials.
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10324
  • In Soviet Russia, text read you!
    • View Profile
    • William's Blog
Re: Joe's Files
« Reply #10 on: February 14, 2006, 07:53:31 AM »
Oh. You told me to set those when we first started, so eh?
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7507
  • One for a Dime two for a Quarter!
    • View Profile
Re: Joe's Files
« Reply #11 on: February 14, 2006, 09:14:07 PM »
I meant "arn't" you messing with them. Realmode is the never ending war against segments.
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling