亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? kmemmgr.h

?? 小型的操作系統開發的原代碼
?? H
字號:
//***********************************************************************/
//    Author                    : Garry
//    Original Date             : May,31 2004
//    Module Name               : kmemmgr.h
//    Module Funciton           : 
//                                This module countains the kernal memory
//                                management code.
//    Last modified Author      :
//    Last modified Date        :
//    Last modified Content     :
//                                1.
//                                2.
//    Lines number              :
//***********************************************************************/

#ifndef __KMEMMGR__
#define __KMEMMGR__

//
// Here,we spend some time to descrip the kernal memory layout in detail.
// In Hello China,the kernal memory space is from 0x00000000 to 0x013FFFFF of the
// PHYSICAL memory,it's size is 20M,so,to run Hello China,the target machine's
// physical memory must larger than 20M.
// When the OS is loaded from DISK(floppy or other storage),it resides in low 1M
// memory,because in this time the CPU is working in Real Address Mode(RAM),only
// can address 1M memory.
// When the Hello China is loaded into memory,it begins to execute,first,it form
// the system tables(such as GDT,IDT,etc),fill them in system registers,and transform
// the CPU's working mode to Protected Mode(PM),then,CPU can address all of the 32 bit
// memory space,in that time,Hello China will move itself from low 1M space to up space,
// and the low 1M space is reserved to use in future.
// In currently,Hello China kernal's size would not exceed 1M,so we reserve 1M space to
// be used by Hello China kernal,that space is from 0x00100000 to 0x00200000 of physical
// memory.
// We also reserve 64K space as stack space,it's address is from 0x013EFFF0 to 0x013FFFF0,
// the 16 byte of the top 20M space (from 0x013FFFF0 to 0x013FFFFF) is reserved.
// The space between Hello China kernal to stack space is used to as kernal memory,so,the
// detail layout of the kernal memory is :
//
//                Range                  Size                   Description
//
//    0x00000000  ---------  0x000FFFFF  1M     BIOS data area,hardware buffer,such as VIDEO,
//                                              etc,and the other space of this space is reserved
//                                              for future use.
//    0x00100000  ---------  0x001FFFFF  1M     Hello China's kernal,including Mini-Kernal and 
//                                              Master.
//    0x00200000  ---------  0x013EFFFF  <18M   System kernal memory,buffers,etc.The hardware 
//                                              device driver is loaded into this space,this
//                                              space also used by device drivers.
//    0x013F0000  ---------  0x013FFFF0  <64K   Kernal stack.
//                                              In fact,the kernal stack's size is less than
//                                              64k,it's actually size is 64K - 15 byte.
//    0x01400000  ---------  0xXXXXXXXX  XXX    To be used as application.
//
// The system kernal memory is managed by kernal memory manager,this block of
// memory is separated into two memory pools,one is 4k block memory pool,and
// another is any size memory block pool.The memory client can commit memory
// allocation request to kernal memory manager,using the routine KMemAlloc,
// this function's parameter indicates which pool is used to allocate memory
// from.If the pool is 4k size pool,the request can only get 4k times memory
// blocks,if the request pool is any size,then the client can get any size 
// memory blocks(in fact,the kernal manager can only allocate memory blocks
// whose size is large than 16 byte).
// The first pool's range is from 0x00200000 to 0x00BFFFFF,total 10M space,
// and the second pool's range is from 0x00C00000 to 0x013EFFFF,about 8M space.
// The reason first pool is larger than second pool is,we recommand that the
// hardware device driver allocate memory from 4k pool.
//
//
//

#define KMEM_MAX_BLOCK_SIZE       0x00100000   //Max memory block size can be
                                               //allocated one time.
                                               //This restrict only apply to 4k
                                               //memory pool.

#define KMEM_4K_START_ADDRESS     0x00200000   //The start address of 4k memory pool.
#define KMEM_4K_END_ADDRESS       0x00BFFFFF   //The end address of 4k memory pool.

#define KMEM_ANYSIZE_START_ADDRESS 0x00C00000  //The start address of any size memory pool.
#define KMEM_ANYSIZE_END_ADDRESS   0x013EFFFF  //The end address of any size memory pool.
                                               //NOTICE: In fact,the any size pool's length
                                               //is less than 8M,it's actually size is:
                                               //0x013EFFFF - 0x00C00000 + 1 = 127*64K.

#define KMEM_MAX_4K_POOL_NUM      16

#define RoundTo16(x) (x = (x&15) ? x - x&15 + 16 : x)

#define RoundTo4k(x) (x = (x&4095) ? (x - x&4095) + 4096 : x)

#define KMEM_MIN_ALOCATE_BLOCK 16
//
//Clear one bit of the DWORD.
//The position of the bit to be cleared is indicated by index.
//
#define ClearBit(dw,index)  (dw = dw & ~(0x01 << index))

//
//Size type.Any module of the kernal can allocate the three type memory blocks:
//Any Size,1K,and 4K.
//
#define KMEM_SIZE_TYPE_ANY       0x00000001
#define KMEM_SIZE_TYPE_1K        0x00000002
#define KMEM_SIZE_TYPE_4K        0x00000003

//
//Memory management structures.
//
/*struct __ANYSIZE_BLOCK{
	LPVOID         pStartAddress;        //Start address.
	DWORD          dwBlockSize;          //Block size.
	__ANYSIZE_BLOCK* pPrev;                //Previous object.
	__ANYSIZE_BLOCK* pNext;                //Next object.
};*/                                         //Any size block management structure.

/*typedef struct __tag1K_BLOCK{
	LPVOID*        pStartAddress;
	__tag1K_BLOCK* pPrev;
	__tag1K_BLOCK* pNext;
}__1KSIZE_BLOCK;                        //1K size memory block.*/

struct __4KSIZE_BLOCK{
	LPVOID         pStartAddress;
	DWORD          dwMaxBlockSize;      //Max block size can be allocated in 
	                                    //current block pool.
	DWORD          dwOccupMap[8];       //Occupying map,one bit maps to one 4k
	                                    //block,if this bit is 1,this 4k block
	                                    //is occupied,otherwise,this 4k block
	                                    //is free.
};                                      //4K size memory block.


//
//Global functions defination.
//
LPVOID KMemAlloc(DWORD,DWORD);          //Alocate a kernal memory block.
                                        //The first parameter gives the block size,
                                        //And the second gives the block type.

//VOID   KMemFree(LPVOID,DWORD dwSizeType = KMEM_SIZE_TYPE_4K,DWORD dwSize = 4096);
VOID  KMemFree(LPVOID,DWORD,DWORD);
                                        //Free a kernal memory block.
                                        //The first parameter gives the start address,
                                        //and the second gives memory block type.

#endif //kmemmgr.h

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日产欧美精品一区二区三区| 欧美一区二区精品久久911| 欧美一级黄色录像| 亚洲天堂成人在线观看| 国产自产高清不卡| 7777精品伊人久久久大香线蕉完整版 | 黑人精品欧美一区二区蜜桃| 91福利在线看| 欧美极品美女视频| 蜜桃av噜噜一区| 色婷婷久久久亚洲一区二区三区| 久久亚洲二区三区| 日韩va亚洲va欧美va久久| 91福利视频久久久久| 欧美国产成人在线| 寂寞少妇一区二区三区| 777午夜精品免费视频| 一区二区三区高清在线| 成人av影视在线观看| 精品播放一区二区| 日韩福利电影在线| 欧美影院一区二区| 国产精品国产自产拍在线| 激情成人综合网| 在线播放欧美女士性生活| 亚洲精选一二三| 成人av电影在线播放| 久久精品在线观看| 久久99在线观看| 7777精品久久久大香线蕉| 一区二区三区不卡视频| jvid福利写真一区二区三区| 久久精品夜色噜噜亚洲a∨| 精品亚洲成a人在线观看| 日韩一区二区麻豆国产| 午夜国产精品一区| 欧美日韩一级片在线观看| 亚洲一区二区五区| 欧美综合一区二区三区| 亚洲柠檬福利资源导航| 99精品热视频| 中文字幕亚洲在| 福利一区福利二区| 国产日韩欧美不卡在线| 国产精品一区在线| 久久久国际精品| 国产毛片精品国产一区二区三区| 精品国产污网站| 精品一区精品二区高清| xfplay精品久久| 国产一区二区久久| 久久久国产午夜精品| 国产a区久久久| 黄色精品一二区| 337p日本欧洲亚洲大胆色噜噜| 精品一区二区三区在线观看国产 | 欧美视频日韩视频| 一区二区三区中文在线观看| 在线观看一区二区精品视频| 亚洲在线成人精品| 欧美精品乱码久久久久久| 日日摸夜夜添夜夜添亚洲女人| 欧美福利一区二区| 久久 天天综合| 久久精品欧美一区二区三区不卡 | 国产福利精品一区二区| 综合欧美亚洲日本| 欧美日韩在线亚洲一区蜜芽| 日韩av中文字幕一区二区三区| 欧美va亚洲va香蕉在线| 国产91在线看| 亚洲免费观看高清完整版在线| 欧美日韩亚洲综合一区| 久久国产乱子精品免费女| 国产欧美日韩中文久久| 色综合色狠狠综合色| 亚洲一区二区三区精品在线| 日韩天堂在线观看| 丰满白嫩尤物一区二区| 一区二区三区欧美| 欧美大片一区二区三区| 成人午夜碰碰视频| 亚洲一二三四在线观看| 欧美大片在线观看| 99久久精品费精品国产一区二区| 午夜国产精品一区| 欧美激情中文字幕一区二区| 欧美三级韩国三级日本三斤 | 亚洲蜜桃精久久久久久久| 欧美精品 国产精品| 国产成人免费视频| 亚洲风情在线资源站| www激情久久| 色天使色偷偷av一区二区| 美女一区二区视频| 中文字幕色av一区二区三区| 欧美精品色一区二区三区| 成人小视频免费在线观看| 天堂一区二区在线| 欧美国产在线观看| 欧美精品aⅴ在线视频| 成人a级免费电影| 青草国产精品久久久久久| 日韩一区日韩二区| 日韩免费看的电影| 99re视频精品| 国产麻豆欧美日韩一区| 五月天激情小说综合| 国产精品国产成人国产三级 | 成人动漫中文字幕| 日韩精品国产精品| 国产午夜精品福利| 日韩高清在线不卡| 加勒比av一区二区| 精品国产一区二区三区四区四| 久久精品欧美日韩精品| 午夜视频一区二区三区| 国产精品综合网| 欧美喷水一区二区| 国产精品美女久久久久av爽李琼| 一区二区在线电影| 国产精品一区二区在线观看网站| 91国产福利在线| 亚洲欧美国产毛片在线| 欧美精品电影在线播放| 精品午夜久久福利影院| 亚洲成人av一区二区| 亚洲色图在线播放| 国产欧美日韩视频一区二区| 日韩欧美国产精品一区| 欧美日韩国产电影| 在线欧美小视频| av亚洲精华国产精华精| 国产乱子伦视频一区二区三区 | 国产精品女上位| 精品三级av在线| 制服丝袜av成人在线看| 欧美日韩综合色| 在线观看亚洲专区| 91美女在线看| 99国产精品一区| 成人av在线资源网站| 丁香六月综合激情| 国产精品99久久不卡二区| 黄色小说综合网站| 精品一区二区三区免费毛片爱 | 一区二区三区中文字幕电影| 亚洲欧洲精品一区二区精品久久久 | 国产电影精品久久禁18| 精品一区二区精品| 精品一区二区三区免费毛片爱| 美女网站色91| 欧美a级一区二区| 免费美女久久99| 免费国产亚洲视频| 理论片日本一区| 久久精品国产第一区二区三区| 日韩av一区二区在线影视| 青青国产91久久久久久| 美女视频黄频大全不卡视频在线播放| 无码av免费一区二区三区试看| 午夜成人免费电影| 日韩高清欧美激情| 乱中年女人伦av一区二区| 精品一区二区三区免费毛片爱 | 亚洲第一av色| 日韩精品亚洲专区| 久草热8精品视频在线观看| 久久精品99国产精品日本| 精彩视频一区二区三区| 国v精品久久久网| www.成人在线| 91精品福利视频| 欧美日韩在线综合| 日韩欧美一区在线观看| 精品国产一区二区三区忘忧草 | 中文字幕高清一区| 中文字幕中文乱码欧美一区二区| 一区精品在线播放| 亚洲免费大片在线观看| 午夜精品一区二区三区三上悠亚| 日韩精品高清不卡| 国内精品不卡在线| 成人av网站大全| 欧美日韩中文精品| 日韩精品一区二区在线| 国产欧美精品一区aⅴ影院| 亚洲男人的天堂一区二区| 天使萌一区二区三区免费观看| 美洲天堂一区二卡三卡四卡视频| 国产高清精品久久久久| 91免费看视频| 欧美一区二区三区在线看| 久久久久久99精品| 一区二区三区成人| 精品一区二区免费| 91免费看`日韩一区二区| 欧美精品久久一区二区三区| 国产亚洲一区二区三区四区| 亚洲精品videosex极品|