LiangShuang's ...

I'm not a programmer...

quartus10.0在fc14上的安装

shuang posted @ 2010年12月20日 08:09 in ecos-on-leon3 with tags quartus10.0 fedora14 vim hex editor , 3810 阅读

    因为要在Altera的De2-70的板子上跑leon3的平台了,所以在fedora下装个quartus玩玩。下载quartus10.0 for linux的过程也相当的搞笑,从altera的官网上下了2天没下下来,由于是教育网用了代理之后也只有几十k的速度,随后又叫同学在电驴上找了个资源,7.1G,好不容易下下来了,可是更悲剧的是居然下的是windos的版本,还以为这么大的安装文件会同时含有两个系统的呢。就在走投无路时想起了工大的最大的软件分享ftp,于是到上面去看看,结果就在Engineering.General/EDA/这个目录下居然有Altera公司的软件,进去一看果然有Quartus II.V10,下载速度最快达到8M,这下可High了!

    很快就下完了,于是挂载到fedora下,./setup,结果没有出现安装界面,只是几行错误提示

“Starting GUI. If nothing shows up, or you don't have an X display, run:
   ./setup --help
for commandline usage.
NOTE: All output has been redirected to /tmp/altera_setup.log,在网上查了以下是libX11.so.6的依赖问题,我们需要让quartus调用我们系统下的/usr/lib下的libX11.so.6文件,而不是.../altera_installer/bin下的那个,mv .../altera_installer/bin/libX11.so.6 .../altera_installer/bin/libX11.so.6.bak,然后再执行./setup就可以一路安装下去了。

    安装完成后更新PATH,echo "export PATH=$PATH:/opt/Programs/altera/10.0/quartus/bin/" >> ~/.bashrc,source ~/.bashrc,然后就可以执行quartus了,问题又出现了“quartus: error while loading shared libraries: libsys_cpt.so: cannot enable executable stack as shared object requires: Permission denied“,还以为是没有破解的原因所以没法运行,就去CSDN上下了个破解文件,替换掉.../linux/下的libsys_cpt.so,可是还是同样的错误,看了网上的破解方法说需要改libsys_cpt.so来完成破解,需要一个hex编辑器,网上查过之后说配置以下vim就能直接打开hex类型的文件了,在vim下输入:help hex就可以找到.vimrc的配置说明,

" vim -b : edit binary using xxd-format!
        augroup Binary
          au!
          au BufReadPre  *.bin let &bin=1 
          au BufReadPost *.bin if &bin | %!xxd 
          au BufReadPost *.bin set ft=xxd | endif
          au BufWritePre *.bin if &bin | %!xxd -r
          au BufWritePre *.bin endif 
          au BufWritePost *.bin if &bin | %!xxd
          au BufWritePost *.bin set nomod | endif
        augroup END

只需要把这段添加到.vimrc中,然后将bin全部替换成所要编辑的二进制文件的扩展名即可,":%s/bin/so/g",然后容vim就可以直接打开.so文件修改了,修改的地址可以通过两种方法获得,其实就是找到函数l_pubkey_verify相对于文件的位置,Quartus验证license的key就是调用libsys_cpt.so中的这个函数,返回0则认为合法,所以就在函数的入口点直接改成

xor %eax, %eax 

ret

即可,也就是16进制的0x31 0xc0 0xc3,那么怎么获得函数的入口地址呢?两种方法,其一利用gdb,执行

gdb> file libsys_cpt.so
gdb> info function l_pubkey_verify

还有一种方法就是利用nm工具,nm libsys_cpt.so | grep l_pubkey_verify,这样就可以找到入口地址进行修改了,我的返回结果是

000a7783 W l_pubkey_verify,改完了之后就应该没问题了,可是还是提示“cannot enable executable stack as shared object requires: Permission denied“这才意识到是权限问题,上网查了以下fedora对于运行.so文件的相关问题,在Fedora及RedHat下,Selinux太过严格。可以将Selinux置为“禁止”,这里我没有禁止,只是打开了一个控制开关

#setsebool -P allow_execstack 1

然后执行quartus就OK了。

    接下来就是license的问题了,网上说直接找个windows下的license.dat文件替换网卡物理地址就行了。

    听说linux下的USB-Blaster很难弄,正好在安装过程中发现一篇文章讲如何设置的,特挂载此,以后在研究以下

    http://bbs.pku.edu.cn/bbs/bbstcon.php?board=Admin1_lobby&threadid=2026459

civaget 说:
2023年12月12日 09:00

A well-executed 백링크 strategy can transform your website's SEO performance. Quality always trumps quantity. Understand the nuances of backlink acquisition to excel in the digital realm.

civaget 说:
2023年12月14日 00:12

Downloading videos on 폰허브 for offline viewing is a game-changer.

civaget 说:
2023年12月17日 00:37

 

제주오피 - Your partner in wellness discovery.

civaget 说:
2023年12月19日 02:03

강남오피's extensive network of over 70 locations, skilled therapists, and diverse services guarantee an exceptional relaxation experience in Gangnam. Don't miss it!

civaget 说:
2023年12月24日 02:19

With 스포츠중계, sports entertainment has reached new heights.

civaget 说:
2023年12月31日 02:55

Don't miss "평택휴게텔." Their skilled therapists and range of massages ensure a wellness experience beyond compare.

civaget 说:
2024年1月07日 03:34

부천출장마사지 is a sanctuary for relaxation. The therapists are skilled, and the atmosphere is serene.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter