flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > Why can't I resize application mem more then 0xa3fffff?

Author
Thread Post new topic Reply to topic
yyc650102



Joined: 01 Jun 2006
Posts: 11
yyc650102 07 Jul 2006, 05:46
I use function call 64/1 to resize application memory. However, if the new size exceed 0xa3fffff, I will get result of 1 (means fail). Is the kernel limited the application memory size? I want to allocate all available free memory, how should I do?

In addition, where is the free memory of appliaction starts from before and after resizing memory?

Thanks!!
Post 07 Jul 2006, 05:46
View user's profile Send private message Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 284
Ville 10 Jul 2006, 08:59
The amount of memory is specified in Config.mnt ( default 256 MB ).

You can read the memory usage for application with system calls 111 and 9/2.
Post 10 Jul 2006, 08:59
View user's profile Send private message Reply with quote
yyc650102



Joined: 01 Jun 2006
Posts: 11
yyc650102 12 Jul 2006, 03:37
appreciate your response!!!!!


I changed it and I can resize app. mem. up to 0x7a3fffff. However, I cannot exceed this value any more, even 1 byte.

So, I wonder...
1. Is Menuet64 reserve at least 92Mb of memory for system ??
2. Is system call 64/1 limit the new size ??


In addition, I reads the documentation of syscall 9/2 and 111. Then I have following ideas for getting the pointer of free memory. I am not sure it's right or not....
1. use 111 to get pid
2. use 9/2 to get the structure of process info.
3. a=get "process start at physical memory" from offset 256
4. b=get "process memory usage" from offset 296
5. So, free memory area is located between (a+b) and (a+"app. mem from header or I resized").
am I right?

My system is...
Dual core Xeon with 4GB of memory (DDR2 FBDIMM, Max. 32GB)

Thanks again!!
Post 12 Jul 2006, 03:37
View user's profile Send private message Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 284
Ville 16 Jul 2006, 09:23
Menuet64 reserves a 40 MB block for system data. Menuet application uses one continuous memory area for code and data. System call 64/1 specifies the new amount of memory you can access within the application.

For example, after calling 64/1 with parameter 0x200000, you can access 0-0x200000, which includes the program image and stack area. The application memory starts always at offset 0x0 and program image is loaded to the beginning of the area.

> 5. So, free memory area is located between (a+b) and (a+"app. mem
> from header or I resized"). am I right?

Free _data_ area is located from ( program image end ) to ( memory size defined in header or with 64/1 ). Notice that stack is also located to this very same memory area, do not overwrite Wink
Post 16 Jul 2006, 09:23
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.