无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 15585|回复: 29
打印 上一主题 下一主题

[分享] fbinst编译for linux和windows--- 更新版本号1.7

  [复制链接]
跳转到指定楼层
1#
发表于 2013-9-22 10:44:00 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
突然醒悟,原来可以交叉编译的,
稍微修改了一下源码,
在slitaz4.0 系统下完成了2种的编译。

得出的编译结果测试了,完全一致。

没有做什么功能修改,只是将版本号提升为1.7


附件包含了2个文档,
linux下的fbinst
windows下的fbinst.exe

fbinst.zip (158.04 KB, 下载次数: 525)


大家有需要研究的下载使用吧。

如果有提问,我会回答。

随便就贴出使用方法吧,
以下文字由./fbinst --help > 1.txt 产生。
  1. Usage:
  2.         fbinst [OPTIONS] DEVICE_OR_FILE COMMANDS [PARAMETERS]

  3. Global Options:
  4.   --help,-h                Display this message and exit
  5.   --version,-V                Print version information and exit
  6.   --list,-l                List all disks in system and exit
  7.   --verbose,-v                Print verbose messages
  8.   --debug,-d                Use the debug version of mbr

  9. Commands:
  10.   format                Format disk
  11.     --raw,-r                Format with normal layout (not bootable)
  12.     --force,-f                Force the creation of data partition
  13.     --zip,-z                Format as USB-ZIP
  14.     --fat16                Format data partition as FAT16
  15.     --fat32                Format data partition as FAT32
  16.     --align,-a                Align to cluster boundary
  17.     --nalign,-n NUM                NAND alignment
  18.     --unit-size,-u NUM        Unit size for FAT16/FAT32 in sectors
  19.     --base,-b NUM        Set base boot sector
  20.     --size,-s NUM        Set size of data partition
  21.     --primary,-p NUM        Set primary data size
  22.     --extended,-e NUM        Set extended data size
  23.     --list-size,-l NUM        Set size of file list
  24.     --max-sectors NUM        Set maximum number of sectors per read
  25.     --chs                Force chs mode
  26.     --archive FILE        Initialize fb using archive file
  27.   restore                Try to restore fb mbr
  28.   update                Update boot code
  29.   sync                        Synchronize disk information
  30.     --copy-bpb                Copy bpb from the first partition
  31.     --reset-bpb                Reset bpb to inital state
  32.     --clear-bpb                Clear bpb
  33.     --max-sectors NUM        Set maximum number of sectors per read
  34.     --chs                Force chs mode
  35.     --zip,-z                Format as USB-ZIP
  36.   info                        Show disk information
  37.   clear                        Clear files
  38.   add NAME [FILE]        Add/update file item
  39.     --extended,-e        Store the file in extended data area
  40.     --syslinux,-s        Patch syslinux boot file
  41.   add-menu NAME FILE        Add/update menu file
  42.     --append,-a                Append to existing menu file
  43.     --string,-s                The menu items are passed as command argument
  44.   resize NAME SIZE        Resize/create file item
  45.     --extended,-e        Store the file in extended data area
  46.     --fill,-f NUM        Set fill character for expansion
  47.   copy OLD NEW                Copy file item
  48.   move OLD NEW                Move file item
  49.   export NAME [FILE]        Export file item
  50.   remove NAME                Remove file item
  51.   cat NAME                Show the content of text file
  52.   cat-menu NAME                Show the content of menu file
  53.   pack                        Pack free space
  54.   check                        Check primary data area for inconsistency
  55.   save FILE                Save to archive file
  56.     --list-size,-l NUM        Set size of file list
  57.   load FILE                Load from archive file
  58.   create                Create archive file
  59.     --primary,-p NUM        Set primary data size
  60.     --extended,-e NUM        Set extended data size
  61.     --list-size,-l NUM        Set size of file list
复制代码

评分

参与人数 3无忧币 +15 收起 理由
快雪时晴 + 5 很给力!
Mindfly + 5 造福论坛和坛友
clonecd + 5

查看全部评分

2#
 楼主| 发表于 2013-9-22 10:47:41 | 显示全部楼层
本帖最后由 teasiu 于 2013-9-24 06:07 编辑

万分无聊,自己做了1个脚本,然后输入./mk,回答y和n就搞定了2种编译。
下面是输出的编译结果信息:
tux@slitaz:~/Documents$ ./mk
要制作windows的exe程序还是linux的程序,按y是windows: y
rm -f fbinst.exe   fb.mbr version.h fb_mbr.h *.o *.d  # Cleanup
perl ./ver2h.pl version version.h
i586-pc-mingw32-gcc -nostdlib -I. -I./ -Wl,-N -Wl,-T -Wl,./ldscript -o fb.exe fbmbr.S
i586-pc-mingw32-objcopy -O binary fb.exe fb_rel.mbr
rm fb.exe
perl ./bin2h.pl fb_rel.mbr fb_mbr_rel.h fb_mbr_rel
i586-pc-mingw32-gcc -nostdlib -I. -I./ -DDEBUG -DDEBUG_INT13 -Wl,-N -Wl,-T -Wl,./ldscript -o fb.exe fbmbr.S
i586-pc-mingw32-objcopy -O binary fb.exe fb_dbg.mbr
rm fb.exe
perl ./bin2h.pl fb_dbg.mbr fb_mbr_dbg.h fb_mbr_dbg
i586-pc-mingw32-gcc -I./ -I. -Wall -DWIN32 -c -MMD -o fbinst.o fbinst.c
i586-pc-mingw32-gcc -I./ -I. -Wall -DWIN32 -c -MMD -o xdio.o xdio.c
i586-pc-mingw32-gcc -I./ -I. -Wall -DWIN32 -c -MMD -o keytab.o keytab.c
i586-pc-mingw32-gcc -I./ -I. -Wall -DWIN32 -ofbinst.exe fbinst.o xdio.o keytab.o
tux@slitaz:~/Documents$ ./mk
要制作windows的exe程序还是linux的程序,按y是windows: n
rm -f fbinst   fb.mbr version.h fb_mbr.h *.o *.d  # Cleanup
perl ./ver2h.pl version version.h
gcc -nostdlib -I. -I./ -Wl,-N -Wl,-T -Wl,./ldscript -o fb fbmbr.S
objcopy -O binary fb fb_rel.mbr
rm fb
perl ./bin2h.pl fb_rel.mbr fb_mbr_rel.h fb_mbr_rel
gcc -nostdlib -I. -I./ -DDEBUG -DDEBUG_INT13 -Wl,-N -Wl,-T -Wl,./ldscript -o fb fbmbr.S
objcopy -O binary fb fb_dbg.mbr
rm fb
perl ./bin2h.pl fb_dbg.mbr fb_mbr_dbg.h fb_mbr_dbg
gcc -I./ -I. -Wall -DLINUX -c -MMD -o fbinst.o fbinst.c
gcc -I./ -I. -Wall -DLINUX -c -MMD -o xdio.o xdio.c
gcc -I./ -I. -Wall -DLINUX -c -MMD -o keytab.o keytab.c
gcc -I./ -I. -Wall -DLINUX -ofbinst fbinst.o xdio.o keytab.o
回复

使用道具 举报

3#
 楼主| 发表于 2013-9-24 06:03:02 | 显示全部楼层
回答网友提问。
回复

使用道具 举报

4#
 楼主| 发表于 2013-9-24 10:03:48 | 显示全部楼层
jack95 发表于 2013-9-24 08:11
fb_mbr_rel.h 中的版本号不能改,改后就就不直接用目前的grldr读取数据了。也与现有的fba不兼容

有这样的事?
回复

使用道具 举报

5#
 楼主| 发表于 2014-1-7 07:32:16 | 显示全部楼层
bolodhzs 发表于 2014-1-4 10:04
有个问题想要请教神雕大侠有没有在linux下测试fbinst所有的命令是否都可行。

我没有测试,但是,从代码和编译结果来看,是可行的。

点评

我发现都没几个人真正用fbinst直接做启动盘的,这方面仅仅只有命令,而没有教程,我自己测试了下,命令大多不好使,估计是我还是不熟,希望不仅仅是工具出来,还需要教程方法更加有用@teasiu  详情 回复 发表于 2014-1-7 14:21
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-11 12:09

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表