flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Understanding structure of Paging descriptor Goto page Previous 1, 2 |
Author |
|
Tomasz Grysztar 06 Feb 2020, 12:25
It seems you forgot to map your code into memory, you have only mapped a single page at address 0.
|
|||
06 Feb 2020, 12:25 |
|
Tomasz Grysztar 06 Feb 2020, 13:21
Yes, if your code is at address 0x1000, then you need to actually map the memory containing that code there, otherwise CPU is not going to have anything to execute.
|
|||
06 Feb 2020, 13:21 |
|
Fulgurance 06 Feb 2020, 13:30
I have doing this, but this don't work. I think i'm tired
Code: PageDirectory: dd PageTable + 111b dd 1023 dup 0x0 PageTable: dd 0x0B8000 + 111b dd 0x001000 + 111b dd 1022 dup 0x0 |
|||
06 Feb 2020, 13:30 |
|
Tomasz Grysztar 06 Feb 2020, 13:59
Remember that all page tables need to have addresses of form 0XXXXX000h, what you can ensure with ALIGN directive:
Code: align 1000h PageDirectory: dd PageTable + 111b dd 1023 dup 0x0 PageTable: dd 0x0B8000 + 111b dd 0x001000 + 111b dd 1022 dup 0x0 |
|||
06 Feb 2020, 13:59 |
|
Fulgurance 06 Feb 2020, 14:35
Oh yes ... Thanks for your help
Just little question. I'm tired to always calculate the good size of my size to have always multipe of 512 bytes. Are there any solution to calculate the appropriate size ? For example if my file after compilation have size of 6000 bytes, if i would like to calculate how many 512 sectors i need, is it possible to test the result when the result is decimal number ? (6000 / 512 = 11.71865) -> i need 12 sectors (for make floppy image) |
|||
06 Feb 2020, 14:35 |
|
Tomasz Grysztar 06 Feb 2020, 15:42
You can use ALIGN to find out the nearest boundary and then pad with a filling of your choice:
Code: virtual align 512 PADDING = $ - $$ end virtual db PADDING dup 0 Code: align 512 store byte 90h at $-1 |
|||
06 Feb 2020, 15:42 |
|
Fulgurance 06 Feb 2020, 15:57
Hum interesting, i don't know this command. And i have finally found other way to do that. I have seen FASM support conditionnal instruction. Thanks you very much for your help !
|
|||
06 Feb 2020, 15:57 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.