3 * Copyright (C) 2001 Brian Palmer <brianp@sginet.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "multiboot.h"
30 EXTERN(_GetExtendedMemorySize)
33 // get extended memory size in KB
67 // int 15h opt e801 don't work , try int 15h, option 88h
76 // int 15h opt 88h don't work , try read cmos
81 andl $0xffff,%eax // clear carry
87 /* Save return value */
94 /* Restore return value */
106 EXTERN(_GetConventionalMemorySize)
109 // get conventional memory size in KB
123 andl $0xffff,%eax*/ // clear carry
125 /* Save return value */
132 /* Restore return value */
142 _gbmm_mem_map_length:
144 _gbmm_memory_map_addr:
146 EXTERN(_GetBiosMemoryMap)
148 // Retrieve BIOS memory map if available
155 movl $0,_gbmm_mem_map_length
157 /* Get memory map address off stack */
159 movl %eax,_gbmm_memory_map_addr
165 movl _gbmm_memory_map_addr,%edi
169 movl $0x534D4150,%edx // 'SMAP'
170 movl $/*sizeof(memory_map_t)*/24,%ecx
175 cmpl $0x534D4150,%eax // 'SMAP'
178 addl $/*sizeof(memory_map_t)*/24,%edi
179 addl $/*sizeof(memory_map_t)*/24,_gbmm_mem_map_length
190 /* Get return value */
191 movl _gbmm_mem_map_length,%eax