Replies: 2 comments 2 replies
-
I'm using OW 1.9 so I posted in the wrong place. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Thanks for the answer. I discovered this post: it describes exactly my case. It seems that the linker bug was resolved in February 2019 in OW 2.0. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I'm porting a tiny experimental 80286 kernel from pure assembler (NASM) to assembler+C (NASM+OW). Boot sector code loads the BIN kernel at address 0x010000 and jumps to that address.
The kernel code, after segs/stack initialization, prints a message: when addressing the message (char*), sometimes the first char is skipped: the print function (puts) begins to print from the 2nd char onwards. Other times, everythng is OK: the string is printed starting from the 1st char.
Expected output:
Hello!
Actual output:
ello!
I discovered that the behaviour depends on the lenght in bytes of the code (text): when everything works, just adding a single (or uneven number of)
nop
instruction somewhere in the code (C or ASM doesn't matter) produces the wrong behaviour. And vice versa. [nop
takes only one byte]Inspecting the assembler code (with WDISM or NDISASM), it seems that WLINK resolves the address of the string message always rounding to even addresses.
I'm a very newbie with OW, so it's highly probable that I'm missing something in the linker parameters; or in the segment specifiers of ASM and C code. Any help will be welcome.
ASM startup code is:
C code is:
Then I have a simple BIOS helper function:
NASM command lines are:
OW command lines are:
os.lnk:
Beta Was this translation helpful? Give feedback.
All reactions