Segmentation error assembly
Segmentation error assembly
(OP)
Hi I am on linux 64bit and when I run the asm code it tells me segmentation error
here is the code:
GNU nano 4.8 main.asm
SECTION .data ; Section containing initialised data
SECTION .text ; Section containing code
global _start ; Linker needs this to find the entry point!
_start: ; Write your instructions between the two noops
mov ax, 5307h
mov cx, 3
mov bx, 1
int 15h
and I use nasm and ld for compiling and linking on 64 bit :
nasm -felf64 main.asm
ld main.o
do anyone have any solution for the problem ?
here is the code:
GNU nano 4.8 main.asm
SECTION .data ; Section containing initialised data
SECTION .text ; Section containing code
global _start ; Linker needs this to find the entry point!
_start: ; Write your instructions between the two noops
mov ax, 5307h
mov cx, 3
mov bx, 1
int 15h
and I use nasm and ld for compiling and linking on 64 bit :
nasm -felf64 main.asm
ld main.o
do anyone have any solution for the problem ?
RE: Segmentation error assembly
> mov ax, 5307h
http://www.ctyme.com/intr/rb-1404.htm
No, you can't just power off the machine with a few simple asm instructions poking away at a non-existent DOS interrupt from the user space of a 64-bit protected operating system.
> do anyone have any solution for the problem ?
Which problem is that?
If you want to know how to interact with the Linux kernel at the ASM level, then you need to read up on that subject.
https://linux-kernel-labs.github.io/refs/heads/mas...
If you want to mess around with old time 16-bit code, then this might help.
https://www.dosbox.com/
You would install some 16 bit assembler inside DOSBox.
You then write your 16 bit ASM code and watch DOSbox shutdown.
--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
RE: Segmentation error assembly
I have searched about the code to shutdown my computer in assembly linux x86/x64 and it's worked on my pc
now i want to send a hex file built around the code to a machine in my local network to reboot is that possible?
RE: Segmentation error assembly
What does this even mean?
Normally, if you want to remote admin a machine on your local network, you 'ssh' into it and issue the shutdown command to shutdown or reboot.
--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
RE: Segmentation error assembly