2006年二月月 发布的文章

小议'霍元甲'

霍元甲,乃一代忠师,大侠级人物,岂敢非议。这里说的是近期热播的同名电影’霍元甲’。记忆中没有看过关于’霍元甲’的作品,关于精武门的多是演绎’陈真’。这次李连杰既’精武英雄’后再次演绎’精武作品’,不过主角儿换成了’霍元甲’,值得期待值得观赏,不说别的,就冲着李连杰(我最喜欢的武打明星之一^_^),我也不能放过这部电影。

‘列强们的坚船巨炮轰开了中国尘封已久的国门’,这是’霍元甲’电影的开场白,轰鸣的炮声回荡在脑中,心中不由得泛起历史的波澜。影片倒叙的手法让我们首先欣赏到几场精彩的擂台打斗戏。’真枪实弹’的擂台戏是最让电影武术设计人员头疼的,擂台空空,无遮无拦,这让很多’特技手段’都力不从心。不过就我看来’霍剧’的擂台戏编排设计的还是颇为成功的,其武指袁和平应该说功不可没呀。

看到1/3处,剧情感觉有点步入’小混混争斗’阶段,或又好似上世纪初的上海黑帮争斗,’霍元甲’带着一身黑衣打扮的徒弟,让我不能不联想到去年’功夫’中的’斧头帮’。虽说一部商业电影中’符实’成分不必太过于追究,但是这样去演绎一个英雄人物,卫冕有些’过’了。看到这我未免产生了些许失望之意,但转念又一想商业电影毕竟不是’纪录片’,继续看吧。

看到1/2处,情节又让我联想到了李连杰早期的一部作品’张三丰’。不同的年代,相似的悲喜情节。

结尾处’霍元甲’自然逃脱不了其真实的结局。在看台上观众的齐声呼叫中,他做到了其一介武夫的’死得其所’。

总结一下本剧的最大看点仍限于’李连杰’的高超武术表演上,这点看来与其以往的作品想比并没有什么创新。本剧在画面质量上唯一让我眼前一亮的是月慈居住的那个少数民族场所,那简直就是个’世外桃源’,一切都是那么的静谧,对,就是那种’出淤泥而不染’的境界,相信很多观众在这点儿上都会与我有共鸣。从电影中还可以证明一点:那就是武德武品才是中华武术之精粹所在,我想这也是电影想表达的主题之一。最后我想以影片中精武体操会的精神共勉: ‘精武体操会, 崇尚三育:育体、育智、育德。武术乃育体修身之法。无分门派,以交流互进为其精髓。体格健壮,智德兼备。国民方能振兴志强。不得以我之拳加于同胞之身,不得滥用武术歧洋排外。仁义为本,自强不息’。

Goto 'Bootstrap'

The term ‘Bootstrap’, which originally refers to a person who tries to stand up by pulling his own boots, refers to a subroutine used to establish the full routine(its own left part, i think) or another routine in computer science. Today modern computers act as a vital role in our daily life and many of you may wonder what happens to the computer when you have it powered on. The ‘Bootstrap’, which is also called ‘boot’ for short, is the first step to be done by the computer. The process of ‘Bootstrap’, which starts on when the computer is powered on and usu ends off when the kernel of the operating system begins to run, is just what we are gonna describe.

As a matter of convenience, we are gonna try to understand the ‘Bootstrap’ process of linux operating system on platforms compatible with ‘i386′, since linux is source-opened and its source is absolutely free. We can boot linux from any bootable devices, such as hard disk, floopy, or cd-rom. We choose to boot from a hard disk which is more complex than the other two. Now we suppose a linux-installed computer is in front of us. Press the power button and we will go to the ‘Bootstrap’ process.

The normal ‘Bootstrap’ flow can be described as following:
[Hardware initialization] -> [BIOS routine] -> [Bootloader run] -> End (Kernel startup) :-)

1. Hardware initialization
Immediately after the power-up or an assertion of the RESET# pin, the processor performs a hardware initialization and an optional built-in self-test(BIST for short). The hardware initialization sets the processor’s registers to a known state and places the processor in real-address operating mode which we have mentioned in "
Inside the ‘i386′". The process state after power-up or reset is vatal, since it decides the address of the code from which the processor is going to execute. Here lists the initial states of some registers:

(1) R[EAX] = R[EBX] = R[ECX] = R[ESI] = R[EDI] = R[ESP] = R[EBP] = 0×00000000 (Note: If the value in the EAX register does not equal to 0H after the BIST, it indicates that a processor fault was detected.)
(2) the EDX register contains component identification and revision information and different values indicate the various members of these Intel Architecture families.
(3) R[CS] = 0xF000 (Note: In its hidden part, ‘Base’ = 0xFFFF0000, Limit = 0xFFFF, AR = Present, R/W, Accessed.)
(4) R[DS] = R[ES] = R[FS] = R[GS] = R[SS] = 0×0000 (Note: In their hidden parts, ‘Base’ = 0×00000000, Limit = 0xFFFF, AR = Present, R/W, Accessed.)
(5) R[EFLAGS] = 0×00000002 (Note: The 10 most-significant bits of this register are undefined following a reset. Software
should not depend on the states of any of these bits.)
(6) R[EIP] = 0x0000FFF0

After the hardware initialization, The first instruction that is fetched and executed is located at physical address 0xFFFFFFF0. The BIOS EPROM containing the software initialization code must be located at this address, otherwise the processor can not locate and fetch its first instruction. Here we know that the processor is using ‘Read-Address mode model’, since it is in ‘real-address’ operating mode. but the address 0xFFFFFFF0 is beyond the 1-MByte addressable range of the processor while in real-address mode. How is the processor initialized to this starting address? As mentioned in "Inside the ‘i386′", the CS register has two parts: the visible segment selector part and the hidden base address part. In real-address mode, the base address is normally formed by shifting the 16-bit segment selector value 4 bits to the left to produce a 20-bit base address according to the normal rule. However, during the hardware initialization, the normal rule doesn’t be followd. the segment selector in the CS register is loaded with 0xF000 and the base address is loaded with 0xFFFF0000. The starting address is thus formed by adding the base address to the value in the EIP register (that is, 0xFFFF0000 + 0xFFF0 = 0xFFFFFFF0). The first time the CS register is loaded with a new value after the hardware initialization, the processor will follow the normal rule for address translation in real-address mode (that is, [CS base address = CS segment selector * 16]). To insure that the base address in the CS register remains unchanged until the EPROM based software initialization code is completed, the code must not contain a far jump or far call or allow an interrupt to occur (which would cause the CS selector value to be changed).

2. BIOS routine (software initialization)
Here, the hardware initialization of the processor is over and the first instruction, which is also the first one of BIOS routine, is executed. From now on, the BIOS routine, which is the very first program run by the processor takes control and begins to run. ‘BIOS’(Basic Input/Output System) is the software embedded on a chip (usu EPROM) located on the computer’s main board and it is also called ‘firmware’.

The BIOS routine also uses ‘Real-Address’ mode model and performs the following operations:
[Power-on self-test] -> [Hardware devices initialization] -> [Load boot sector] -> End (the loaded sector takes control) :-)

(1) Power-on self-test (POST)
The BIOS routine executes a series of tests to establish which devices are present and whether they are working properly. It also initializes the standard devices, such as the memory controller, video controller, IDE controller and floppy controller. Using stored parameters, it initializes the motherboard chipset, and sets timing parameters. It also creates an interrupt vector table and provides a set of services, accessible through interrupts, that allow access to the standard I/O devices. During this phase we may get some messages displayed on the screen, such as the BIOS version banner or etc.

(2) Hardware devices initialization
In this phase, the BIOS routine guarantees that all hardware devices operate without conflicts on the IRQ lines and I/O ports and a table of installed PCI devices will be displayed on the screen.

(3) Load boot sector
After the ‘POST’ and the initialization of hardware devices, the BIOS routine call ‘Int19H’ service routine to search for the valid boot sector, which has the signature ’0x55AA’ in its last two bytes. As soon as a valid sector is found, the BIOS routine continues to call ‘Int13H’ service routine to load the valid sector to the address ’0x00007C00′, and then jumps into this address and executes the code just loaded.

3. Bootloader run
The valid sector loaded from hard disk by BIOS routine is usu called ‘Master Boot Sector’, which consists of ‘Master Boot Record(MBR)’, ‘Disk Partition Table(DPT)’ and ‘Boot Record ID(0x55AA)’. Usu the MBR stores a small program which used to load the first sector of the partition containing the operating system to be started. Today a two-stage boot loader such as LILO, GRUB is required to boot a Linux kernel from disk. These bootloaders may be installed either on the MBR (replacing that small program that loads the boot sector of the active partition) or in the boot sector of every disk partition. Whatever, the final result is the same. These bootloaders usu are broken into two parts, since they are too large to fit into one single sector, which size is 512 bytes. The MBR or the p
artition boot sector contains the first part of one of these bootloaders, which is loaded into memory from address 0x00007C00 by the BIOS routine. Then the first part program moves itself to another special address (it is 0x0009A000 for LILO), loads the second part of the bootloader into memory and jumps to execute the just loaded code. the second part of bootloader offers user a chance to choose from a list of bootable operating systems from disk. After the user has chosen the kernel to be loaded, the boot loader may either copy the boot sector of the corresponding partition into memory (the user has chosen the kernel in other partition) and execute it or directly copy the kernel image into memory (the user has chosen linux kernel in current partition). If the linux kernel is gonna loaded, the bootloader calls a BIOS routine to load the first 512 bytes of the kernel image to the address 0×00090000 , load the code of ‘setup.S’ to the address 0×00090200 and load the rest of the kernel image to either low address 0×00010000 (for small kernel images compiled with make zImage) or high address 0×00100000 (for big kernel images compiled with make bzImage). At last the bootloader jumps to execute the ‘setup.S’ code.

Here, the ‘Bootstrap’ process has come to a conclusion.

如发现本站页面被黑,比如:挂载广告、挖矿等恶意代码,请朋友们及时联系我。十分感谢! Go语言第一课 Go语言精进之路1 Go语言精进之路2 商务合作请联系bigwhite.cn AT aliyun.com

欢迎使用邮件订阅我的博客

输入邮箱订阅本站,只要有新文章发布,就会第一时间发送邮件通知你哦!

这里是 Tony Bai的个人Blog,欢迎访问、订阅和留言! 订阅Feed请点击上面图片

如果您觉得这里的文章对您有帮助,请扫描上方二维码进行捐赠 ,加油后的Tony Bai将会为您呈现更多精彩的文章,谢谢!

如果您希望通过微信捐赠,请用微信客户端扫描下方赞赏码:

如果您希望通过比特币或以太币捐赠,可以扫描下方二维码:

比特币:

以太币:

如果您喜欢通过微信浏览本站内容,可以扫描下方二维码,订阅本站官方微信订阅号“iamtonybai”;点击二维码,可直达本人官方微博主页^_^:
本站Powered by Digital Ocean VPS。
选择Digital Ocean VPS主机,即可获得10美元现金充值,可 免费使用两个月哟! 著名主机提供商Linode 10$优惠码:linode10,在 这里注册即可免费获 得。阿里云推荐码: 1WFZ0V立享9折!


View Tony Bai's profile on LinkedIn
DigitalOcean Referral Badge

文章

评论

  • 正在加载...

分类

标签

归档



View My Stats