-
大小: 4.22MB文件類型: .gz金幣: 1下載: 0 次發布日期: 2023-09-17
- 語言: 其他
- 標簽: mkfs.jffs2??編譯??安裝??
資源簡介
本資源包括jffs2文件系統源代碼及相關依賴庫源代碼,具體編譯、安裝步驟的詳細說明。
代碼片段和文件信息
//?-*-?mode:?cpp;?mode:?fold?-*-
//?Description??????????????????????????????????????????????????????????/*{{{*/
//?$Id:?main.cv?1.1?1999/08/09?18:04:57?dwmw2?Exp?$
/*?######################################################################
???Linux?Flash?File?System?boot?loader
???This?loader?should?be?able?to?work?with?any?sort?of?linearly?paged?flash
???that?is?mapped?into?the?bios?extension?region.?To?do?so?you?have?to
???customize?the?first?section?to?allow?it?to?speak?to?your?flash.?The
???loader?reads?a?FFS2?filesystem?directly?to?locate?the?image?and?read?it
???into?ram.?You‘ll?need?at?least?a?4K?window?size?prefferably?8K?to?fit?
???the?entire?loader?in.?If?you?only?have?4k?then?you?have?to?use?the?
???SMALLER?loader?that?omits?error?messages?and?error?checking?code?to?
???fit?into?4k.
???TODO:
?????-?A?Simple?and?worthwhile?thing?would?be?to?read?the?kernel?command
???????line?from?the?file?/commandline?on?the?flash?-?this?would?remove?the
???????need?to?hardcode?one?in?here.?Even?better?would?be?a?config?file?but
???????I?haven‘t?the?faintest?idea?what?would?be?usefull?to?put?in?one!
???
???#####################################################################?*/
/*}}}?*/
#include?“local.h“
#include?“io.h“
#include?
#include?
/*?No?more?than?256?blocks?must?be?used?by?the?FFS2.?If?your?flash?window?size
???is?over?4k?then?you?must?compile?with?-DSMALLER?defined?to?strip?out?enough
???code?to?fit?the?extension?in?the?4k?window?*/
static?unsigned?long?EraseSize?=?0x20000;
static?unsigned?long?FlashSize?=?2*1024*1024;
static?unsigned?long?WindowSize?=?32*1024;
static?unsigned?char?*FlashWindow?=?(void?*)0xe8000;
#define?PAGE_IO?0x208
#define?CMDLINE?“auto?rw?root=/dev/mtd1“
//?PageTo?-?Window?Swapping?function /*{{{*/
//?---------------------------------------------------------------------
/*?Handles?the?specific?flash?window?implemenation.?This?one?is?for?the?
???Octagon?board?*/
void?PageTo(unsigned?long?Window)
{
???outb(Window?|?(2?<6)PAGE_IO);
} ????
/*}}}*/
//?Defines?for?the?linux?loader
#define?SETUP_SIZE_OFF?497
#define?SECTSIZE???????512
#define?SETUP_VERSION??0x0201
#define?SETUP_HIGH?????0x01
#define?BIG_SYSSEG?????0x10000
#define?DEF_BOOTLSEG????0x9020
//?From?etherboot?this?is?the?header?to?the?image?startup?code
struct?setup_header
{
???__u8?jump[2];
???__u8?magic[4];?????/*?“HdrS“?*/
???__u16?version;??????/*?>=?0x0201?for?initrd?*/
???__u8?realmode_swtch[4];
???__u16?start_sys_seg;
???__u16?kernel_version;
???/*?note:?above?part?of?header?is?compatible?with?loadlin-1.5?(header?v1.5)*/
???/*???????must?not?change?it?*/
???__u8?type_of_loader;
???__u8?loadflags;
???__u16?setup_move_size;
???unsigned?long?code32_start;
???unsigned?long?ramdisk_image;?
???unsigned?long?ramdisk_size;
???unsigned?long?bootsect_kludge;
???__u16?heap_end_ptr;
};
//?ffs2_read?-?Read?function?from?mapped?flash /*{{{*/
//?---------------------------------------------------------------------
- 上一篇:經典和現代的信道編碼
- 下一篇:STM32L0中文參考手冊新版
評論
共有 條評論