All of lore.kernel.org
 help / color / mirror / Atom feed
* Current break round up
@ 2008-09-30 19:26 Kircsi Tibor
  2008-10-01 13:43 ` Frank Kotler
  0 siblings, 1 reply; 7+ messages in thread
From: Kircsi Tibor @ 2008-09-30 19:26 UTC (permalink / raw)
  To: linux-assembly

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-10-02  7:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-30 19:26 Current break round up Kircsi Tibor
2008-10-01 13:43 ` Frank Kotler
2008-10-01 14:40   ` Tibor Kircsi
     [not found]   ` <61990392562924881677723846250054653396-Webmail2@me.com>
2008-10-01 18:22     ` Frank Kotler
2008-10-01 19:03       ` Kircsi Tibor
2008-10-01 20:27         ` Frank Kotler
2008-10-02  7:27           ` Tibor Kircsi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.