flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
me239 06 Jan 2011, 06:02
First off, hello everyone! I'm new to this forum; however, I've been using FASM for months now. Throughout my speratic programming I've created a few decent bootloaders and eventually my DOS OS xOS. xOS is a simple shell(no file support yet
![]() hello: hello world! echo: echo text after command cls: clear screen restart: restart prompt help: all commands listed alert: my favorite. It creates a messagebox containing the cmdline parameters given and waits for the return key. P.S this is a slightly older version. The new one is on my other computer and has several bug fixes. ![]() NOTE: This is the super beta, before bootable picture of xOS UPDATE: Here is the newest version. Don't be fooled by the "A:\", there is no file support.
Last edited by me239 on 06 Jan 2011, 22:23; edited 3 times in total |
|||||||||||||||||||||
![]() |
|
edfed 06 Jan 2011, 08:27
cool, one more asm OS coder.
![]() good continuation ![]() |
|||
![]() |
|
Dex4u 06 Jan 2011, 18:18
I agree nice work me239.
|
|||
![]() |
|
Mike Gonta 06 Jan 2011, 18:46
me239 wrote: xOS is a simple shell(no file support yet Good job. I took the liberty of translating xOS to 32 bit protected mode to show how easy it is to "overnight" move up to PM32, (which will also boot and run on any PC that can boot from USB flash) with the same ease and simplicity of 16 bit real mode. The PM32 boot sector included with the aeBIOS distribution loads a PM32 flat binary file called kernel.bin to 100000h. This boot sector (located at LBA 36) can be changed or modified. The cmd.bin file (without the boot loader) was renamed "kernel.bin" and copied to the root directory of the aeBIOS image after it is transferred to the USB flash drive. |
|||
![]() |
|
me239 06 Jan 2011, 20:57
Mike Gonta wrote:
WOW, thanks. I would really like to give it file support. Can you help me accomplish this? |
|||
![]() |
|
Dex4u 06 Jan 2011, 21:06
me239 wrote:
If your talking realmode a good starting point would be bootprog http://alexfru.chat.ru/epm.html#bootprog I have converted it to fasm, let me know if you want a copy. |
|||
![]() |
|
me239 06 Jan 2011, 21:37
Dex4u wrote:
Yeah sure. Would you also know where I can find any good documentation on the FAT12 (All I have found tend to be C oriented) also I need to know how to launch a program(such as loading it into memory and such). Thanks ![]() |
|||
![]() |
|
me239 07 Jan 2011, 05:44
Mike Gonta wrote:
Hey, thanks man. I've put aside the FAT12 until the weekend and instead I'm simulating int 21h DOS commands using the IVT! I'll be sure to get on the FAT12 support and file execution as all of these are going to go into a new DOS project mine! I'm not fully abandoning xOS, but it's on hold for a while; however, some functions may be adopted into the new project (eg. "alert"). I'll be sure to update my progress as I go ![]() |
|||
![]() |
|
Mike Gonta 07 Jan 2011, 14:28
me239 wrote: I've put aside the FAT12 until the weekend and instead I'm simulating int 21h DOS commands using the IVT! The format of the Protected Mode Interrupt Descriptor Table Pointer is: Code: pm_idtr: dw NUMBER_OF INTERRUPT_HANDLERS*8-1 dd POINTER_TO_IDT Code: PM_IDTR equ 520h mov esi, [PM_IDTR+2] ; esi points to IDT unprotected memory model can be ignored. The flat 32 bit address of the handler is stored in the entry such that the lower 16 bits is in the first 2 bytes and the upper 16 bits is in the last 2 bytes. Hooking a handled interrupt (aeBIOS provides default handlers for all interrupts - most of which merely do an "iret"), involves saving and replacing the handler address. When the interrupt occurs the new handler will be executed, the last instruction should be: Code: jmp DWORD [saved_interrupt] Here is a simple framework example of establishing a new handler. Code: PM_IDTR equ 520h use32 org 100000h mov esi, [PM_IDTR+2] ; esi points to IDT ; save the original handler - not required for int 21h mov eax, [esi+21h*8] rol eax, 16 mov ax, [esi+21h*8+6] rol eax, 16 mov [saved_int_21], eax ; option not required mov WORD [esi+21h*8], int_21 AND 0FFFFh mov WORD [esi+21h*8+6], int_21 SHR 16 mov esi, message call print xor eax, eax int 16h int 19h print: mov ah, 2 ; Write Character To Standard Output .1: mov dl, [esi] lea esi, [esi+1] test dl, dl je .2 int 21h jmp .1 .2: ret message: db 'Using int 21h is fun!', 0 int_21: pusha cmp ah, 2 jne .1 mov ah, 0Eh xor bh, bh mov al, dl int 10h .1: popa ; optionally can be simply replace with "iret" jmp DWORD [saved_int_21] saved_int_21: dd 0 ; option |
|||
![]() |
|
me239 07 Jan 2011, 22:07
Mike Gonta wrote:
Oh, I'm not making TSR. I'm just setting up IVT's in my new bootloader that copy int 21h. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.