Something Wrong with 64 Bit Code Segments
Something Wrong with 64 Bit Code Segments
NASM doesn't really like when I used [BITS 64], but I couldn't find a replacement for me. It gives me an error saying "Bits must be used with 16 or 32.", or something along those lines. Is it because I'm doing straight binary, or because I'm not using the right directive or what?
Well, thats a kick to the face.... I just figured out how to code the whole thing in NASM, and now I have to make it FASM. Eh, I'll get started. Anyway, why does the NASM manual say it supports [BITS 64]? Thanks.
Do you know if theres a way to check if I'm in Long Mode (not if my computer supports it)? Because I'm not 100% positive I did it right...
Do you know if theres a way to check if I'm in Long Mode (not if my computer supports it)? Because I'm not 100% positive I did it right...
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Fear, I think YASM is what your looking for... ([BITS 64] actually works.. )
Here is a quote from the site:
http://www.tortall.net/projects/yasm/
Here is a quote from the site:
Sadly they didn't include NASM's support for OpenBSD&NetBSD's a.out format so I don't use it personally.Yasm is a complete rewrite of the NASM assembler under the "new" BSD License (some portions are under other licenses, see COPYING for details). Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64, COFF, Win32, and Win64 object formats, and generates source debugging information in STABS, DWARF 2, and CodeView? 8 formats...
http://www.tortall.net/projects/yasm/
- spix
- Member
- Posts: 128
- Joined: Mon Jun 26, 2006 8:41 am
- Location: Millicent, South Australia
- Contact:
Can I ask why you would want a.out on OpenBSD? They haven't been using a.out for quite a few releases, I can't remember which upgrade it was they switched to elf, but it was at least three or four ago (and quite an interesting upgrade).Sadly they didn't include NASM's support for OpenBSD&NetBSD's a.out format so I don't use it personally.
NetBSD uses elf as well, since about 1999.
Andrew
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
I only use NASM for OSDev, not for userland applications.. (I used a.out for my old kernel). I do everything else in C.spix wrote:Can I ask why you would want a.out on OpenBSD? They haven't been using a.out for quite a few releases, I can't remember which upgrade it was they switched to elf, but it was at least three or four ago (and quite an interesting upgrade).Sadly they didn't include NASM's support for OpenBSD&NetBSD's a.out format so I don't use it personally.
NetBSD uses elf as well, since about 1999.
Andrew