Current break round up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Sorry for my english. I started learn assembly again after 15 years.
Now, I'm learning about memory management and sys_brk system call. I've
created a really simple program, which try to extend the heap size. I've
read, when sys_brk is called with the new break address(last usable
address of the heap or data segment), it will be rounded up to the next
nearest page, but it didn't. Am I misundestand somthing?

# meminf.s
# 2008.09.25.
# PURPOSE: Test current_break address round up at sys_brk call

.include "../sharedlibs/linux.s"

.section .text
        .globl  _start
_start:
        movl    %esp, %ebp

        movl    $0, %ebx                # %ebx = 0, get the current
curret_break
        movl    $SYS_BRK, %eax
        int     $INT                    # %eax = address of
current_break

        addl    $0x1002, %eax           # add 4098 to current
current_break
        movl    %eax, %ebx              # %ebx = the address of the new
current_break
        movl    $SYS_BRK, %eax
        int     $INT

        movl    $0, %ebx                # set the return value of the
program
        movl    $SYS_EXIT, %eax
        int     $INT

regards,
Kiri


--
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies]     [Security]     [Linux C Programming]     [Linux for Hams]     [DCCP]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux