Wednesday, October 06, 2010

trip of kangting

We have been to kangting..yes,kangting,again~but no hiking/biking something.because we only have 7-days vacation that we choose the road trip.There's still bunch of beautiful places out there.You're get involve in a natural environment which in the wonderful creations that it must driving you to do some philosophical think.what's the purpose of your frenk'in life?what the kind of ways you need to pursuit with?freedom or dreams in metaphical, code something in physical? that's a hard issues I dont have figure it out yet.Last year,I almost die in a jungle near(35km) to kangting city.After 13 months the process of event still picturing in my mind,pretty clearly.I as a humanoid walking on the suck but wondering world that have to ask about those 3 questions again:where's my LOVE?where's my HOPE?what's the purpose of my life?7 years of itchs,but it's still hard to answer..........

the first mountain in Ya'an area we need to pass.

country side

shangli town


unfortunately,the Talmud doesnt have a full-version of Chinese translation...it doesnt means that I have to learning hebrew,right?

ya'an city


I was hiking here last year

we were passing through the tunnel

kangting



only the idiot dont drink buttered tea when you're reach the highland in the southwest of China


can you writing code within a hot spring pool on 2700m altitude?

this probabaly is highest altitude airport in the planet.4250 meters high on top of the "zheduo" mountain.


airstrip


flying here dude,it's worth to try~


airport entry

we have been stuck in mountain(3900m altitude) caused by traffic jams.damn,where's the fucking traffic police gone?Thank God,we met a group of army and they helped us to passing through,safely.

thanks,buddy.You guys effort made a smooth traffic.


traffic jams for 15km.

hello,yaks!

Xindu Bridge (新都橋)




the path to danba country

beautiful,ha?

tagong town,see?

getting near to danba





Tibetan Village in danba country

castle in danba country



we were going to cross the jiajin mountain.

hightland lake

This place is great.Im going to hiking this place next year.











go home......

Thursday, July 01, 2010

exokernel,can we talk about it?

of course we have to talk about it.Actually we have been trash-talking on OS topics for few months.But we still dont get start to writing the own ones.dont be rush,man.OS is a definitely tough hack in the phenomenon world.It will takes you few years even 10 years get involve with it.sounds hard,right? whatever you think how hard it is,that doenst means we could put it away from our hacking(routines).we still need to keep eyes on it.

You may doubt that how can we keep up with new tech in a fast-food world,while People just focus on things which turning to be rushsss.I dont wanna talk about how people get fucked by this world right now.Just noticed that hardware/software co-hacking are a bunch of logies(ontology,methodology,epistemology) that across the hardcore fields in computer science(and engineering) including OS,compilers,networking.The 3logies is the strongest paradigm which existing for xxxxxx years.It's cames from the most powerful book---The Holy Bible.The 1st time of Jews and Greek's cultural collision happend about 2300 years ago that historical event formed a new way of thinking which Abraham Joshua Heschel was call it "ellipse it revolves" that means we believed something cant to prove it by reasoning but by our pure faith to LORD(religion,theology),and the rest of knowledge we can figure it out by reasoning(philosophy).The interesting is Hebrew(希伯来) and Greek(希腊) are same root in CHinese:-)

Back to the topic.Im a monkey-coder,why do I need to know above?Because you will get different informations on different postions when you hack the kernel(or should I said OS design?).A simple explanation like this:
Ontology->Trying to figure it out what OS it is.
Methodology->trying to stand on different positions look into the paradigm of the OS.
Epistemology->trying to do above 2 again and again that would making a whole organic knowledge system for you.

On the other hand,different languages connected these different world views as same as OS design.Thinking about that,The relationships between the arch of OS itself,scheduler,kernel thread execution just like,you know what,I really wanna saying"Holy Father,Holy Son,Holy Spirit".is there any possibility to reduce those components less than 3?You could try it but it will be sucked.And why does conventional OS(monolithic,even microkernel) has to make a distinction between kernel space and user space?for security issues(sin)?oohh,aha,sinful man living in user space and trying to get some resources from kernel space by scheduler(JC?).pthread is a kind of execution which existing in phenomenon world and...you might know what I want to say,right?...kernel thread is really big stuff do things which sinful man cant go through with "real desert".I cant talk more because I cant give you a clear explanation about Philosophical-Theology Model in english(a world view trouble?).

What's different between conventional OS and exokernel[1]?a lot.really a lot.IMO,exokernel is a better PTM which get closer to "the truth".You'd better take a peek[2] on MIT exo website that provided some documentations(papers)[3].exokernel's model picturing a better world than current one.A meta-kernel has been made,then hackers(not cracker) can customizing their own kernel and build their own app on it.


As a OS amateur,need to keep your mind open and trying to get "a little bit" wisdom from the beautiful creations....wowo,it's been a long bullshit,I think I need to go to bed for reading "Joel on Software"(book)[4].

May Lord's hacking spirit guide us!!!


[1]MIT Exokernel Operating System
http://pdos.csail.mit.edu/exo/

[2]Exopc Exokernel Distribution
http://pdos.csail.mit.edu/exo/distrib.html

[3]documentations
http://pdos.csail.mit.edu/exo/docs.html

[4]Joel on Software
http://www.joelonsoftware.com/

Thursday, May 27, 2010

happy gaming time II

I have a happy gaming time about 2 years ago.The AssassinCreed was a wonderful created by a talented development team,I mean UBI.Thank Lord Im still existing in this suck world and having fun with a great game---AssassinCreedII.The history was occurs in the 15th century when Renaissance getting close to the end.You can see many beautiful architectures in the game world.And even though you can see many corrupts in history of Christianity Church,but (honestly) you still can see the glorious lights from LORD by footprints of history.Im going to share something pictures from snapshots:

That's me.My name is Ezio.One of my great ancestor is altair who has gaming with you in the first edition of the game.

Venice

Florence,the first place you will see in the game world

a monastery.I came here for kick 2 guys ass and get some important infos from a monk

aha,beautiful woman."hello,mamdama"latin or french?

memory is........

Cross making me fear.....fear God,but fear no man!

..............

stealth to the castle

Venice

May Cross's lights guide us!

Santa Maria del Fiore.I wanna trip here(I mean in relative to real world)

it's a kind of Byzantine style architecture

man have a dream to fly...

And,jump dude!

one assassin show can change the world,isnt is?

world cant be changed by 2 man dies.but the 2 man themselves

btw:if you are a hacker(not cracker),I advice you spend 24 hours for gaming the AssassinCreedII.It's worth to try.

Thursday, May 20, 2010

port GNU/Linux kernel 2.6.28.9 to ixp435

Copyright (c) Shawn the R0ck.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation;with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.A copy of the license is included in the section entitled "GNU Free Documentation License".

I have port (by a company Im working for) to ixp420 last month. That would not be fit in your kernel.A standard kernel 2.6.28.9 has been successful to port on kixrp435(ixp435 reference platform) dev-board recently. Im gonna share with you guys about it. There are few stuffs you need to get before you start the hack.

1,Download the files that you will use

2,try to get a cross-compiler(I have been using a customized GNU toolchains by timesys).My armv5b-linux-gcc version is 3.4.1-7

3,Of course you need a kernel-2.6.28.9

4(optional), you can use the rootfs I created.

I totally agree with Ken Thompson said"This is a consequence rather than a goal. I abhor a system designed for the "user", if that word is a coded pejorative meaning "stupid and unsophisticated". That's a good reason dont be expected the doc(or is called "log") might be readable as a literature. I'm writting this for hackers but not as users. Hope can helps.

happy hacking!
May Lord's hacking spirit guide us!

decompress files:
#tar jxvf linux-2.6.28.9
#unzip BSD_ixp400AccessLibrary-3_0.zip
#unzip IPL_ixp400NpeLibrary-3_0.zip
#unzip BSD_ixp400PMU-3_0.zip
#cp -r linux-2.6.28.9/arch/arm/mach-ixp4xx/include/mach linux-2.6.28.9/include
#cp linux-2.6.28.9/arch/arm/include/asm/* linux-2.6.28.9/include/asm/

do "source ixp400_xscale_sw/buildUtils/environment.linux.sh" after you have already set the right path in: ixp400_xscale_sw/buildUtils/environment.linux.sh

Copy the Makefile and Kconfig to your kernel directory that may be:linux-2.6.28.9/driver/net

#cp ixp400_eth.c IxLinuxEDDIoctl.h linux-2.6.28/driver/net
#cp config.bak linux-2.6.28.9/
#cp semaphore.c linux-2.6.28.9/kernel
#cp semaphore.h linux-2.6.28.9/include/linux

edit ixp_osal/platforms/ixp43X/os/linux/include/IxOsalOsOem.h:
replace:
#include "asm/hardware.h"
#include "asm/arch/irqs.h"

with:
#include "mach/hardware.h"
#include "mach/irqs.h"

edit ixp_osal/common/os/linux/include/core/IxOsalOsTypes.h
replace:
#include "asm/semaphore.h"

with:
#include "linux/semaphore.h"

edit ixp_osal/common/os/linux/include/core/IxOsalOs.h
replace "consistent_sync" with "dma_cache_maint"

edit ixp400_xscale_sw/src/oslinux/IxLinuxInit.c
1,add #include "linux/fs.h"
2,comment these 3 lines:
/* if (unregister_chrdev(DEV_IXNPE_MAJOR_NUMBER, "ixNpe"))
{
printk (KERN_ERR "Failed to unregister driver for

/dev/ixNpe\n");
}*/
And,add a line above it:
unregister_chrdev(DEV_IXNPE_MAJOR_NUMBER, "ixNpe")

edit

ixp400_xscale_sw/ixp_osal/common/os/linux/src/modules/ddk/IxOsalOsDdkIrq.c
replace "SA_SHIRQ" with "IRQF_SHARED"


check your kernel config
# make $IX_KBUILD_CROSSCOMPILE menuconfig

compile kernel
# make $IX_KBUILD_CROSSCOMPILE

compile npe driver
# cd ixp400_xscale_sw
# make all

then you will get 3 files(ixp400.ko,IxNpeMicrocode.dat,ixp400_eth.ko)

that's all your ixp435 platform needs.

# insmod ixp400.ko
ixp400: module license 'unspecified' taints kernel.
# cat IxNpeMicrocode.dat > /dev/ixNpe
# insmod ixp400_eth.ko
ixp400_eth: Initializing IXP400 NPE Ethernet driver software v. 1.8
ixp400_eth: CPU clock speed (approx) = 398 MHz
ixp400_eth: Found PHY 0 at address 1
ixp400_eth: Found PHY 1 at address 2
ixp400_eth: Found PHY 2 at address 3
ixp400_eth: Found PHY 3 at address 4
ixp400_eth: Found PHY 4 at address 5
ixp400_eth: ixp1 is using NPEC and the PHY at address 1
ixp400_eth: ixp2 is using NPEA and the PHY at address 2
ixp400_eth: Use default MAC address 00:02:b3:02:02:02 for port 1
ixp400_eth: Use default MAC address 00:02:b3:03:03:03 for port 2

see,it works!

btw:I found a community the named openixp provided many FOSS solutions on ixp platform.unfortunately, it seems it was not update for a "while"

Thursday, April 08, 2010

port GNU/Linux kernel-2.6.28 to ixp4xx(420)

Copyright (c) Shawn the R0ck.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation;with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.A copy of the license is included in the section entitled "GNU Free Documentation License".

I have been doing some porting on ixp4xx(420) for weeks.the boring one is that port the network adapter to kernel-2.6.28.Perhaps there's many ways could be done this job.I tried compile the ixp4xx drivers into kernel-2.6.28.And needed to change a lot in driver code which for fit in the data structures of kernel high-speed changes.in the end,you still need the intel full of shits(accessLib and something else) to provided a link library for complete the compiliation of kernel.Because of Intel as big corporation would never like to accept spirit of GPL and they made a abstraction layer is called accessLib which is followed BSD-license.Intel wants to copping out GPL license and that was the way.The wrost thing is my cross-compiler cant not gernerate these libs.dont laugh on me,I have try more than 4 verions of cross-compilers that all failed.That's why I have to pick a easy way to done this job.That way is port the shit used by snapgear...Hope this roughly document could give you help!

1.Download snapgear-4.0 and extract the files into a folder of snapgear.Download GNU/Linux kernel 2.6.28,you need to move the kernel(after extracted) into directory of snapgear and changes the named of "linux-2.6.28" to "linux-2.6.x"(bash:mv linux-2.6.28 linux-2.6.x).

2.download snapgear-modules-20090807.sh,then move it to snapgear.you will get 4 files after execution(bash: ./snapgear-modules-20090807).And follow the "sexy" README files steps to patching your snapgear distro.

3.because of you wanna get npe modules that you have to add something to linux-2.6.x/Makefile.Find where vmlinux-dirs and vmlinux-alldirs are,and looks like this after correct edited:
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
$(net-y) $(net-m) $(libs-y) $(libs-m) $(EXTRA_MODULE_DIRS)))

vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
$(init-n) $(init-) \
$(core-n) $(core-) $(drivers-n) $(drivers-) \
$(net-n) $(net-) $(libs-n) $(libs-) $(EXTRA_MODULE_DIRS))))

4.if you dont wanna get a error like "/home/snapgear/modules/ixp425/net-2.4/ixp400_eth.c: In function 'port_disable': /home/snapgear/modules/ixp425/net-2.4/ixp400_eth.c:2836: error: implicit declaration of function 'kill_proc'",you need to edit the file of ixp400_eth.c.

before edited:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)

#include "linux..."

#define kill_proc(p,s,v) send_sig(s,find_task_by_vpid(p),0)

#endif

after edited:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)

#include "linux..."

#define kill_proc(p,s,v) send_sig(s,find_task_by_vpid(p),0)

#endif

5.continue to editing a right $(AWK) execution path.add vmlinux-only-dirs = $(filter-out /%,$(vmlinux-dirs)) into linux2.6.x/Makefile for a proper place and replace vmlinux-dirs with vmlinux-only-dirs.Only the second "vmlinux-dirs" need to be replaced that looks like this:

PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
$(Q)$(AWK) '!x[$$0]++' $(vmlinux-only-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order

6.snapgear wouldnt gernerate a right path for ixp400_eth.ko.so you still need to change the linux-2.6.x/scripts/Makefile.modinst like this:

modinst_dir = $(subst $(dir $(TOPDIR))modules/,,$(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D)))

7.edit snapgear\modules\ixp425\ixp400-2.4\ixp400_xscale_sw\src\ethMii\IxEthMii_p.h.add "#define IX_ETH_MII_IP175C_PHY_ID 0x02430d80" near by behind the "/* supported PHYs */"

And,turn to the 172th line of snapgear\modules\ixp425\ixp400-2.4\ixp400_xscale_sw\src\ethMii\IxEthMii.c.Add "|| (ixEthMiiPhyId[i] == IX_ETH_MII_IP175C_PHY_ID)" to where behind the "|| (ixEthMiiPhyId[i] == IX_ETH_MII_RTL8305SC_PHY_ID)"

I tested a version of which doesnt made the changes and snapgear pop up some error.But the network adapter is still works.I dont know what exactly effect on it.

8.you will get a compile error "/home/snapgear/modules/ixp425/net-2.4/ixp400_eth.c:2025: error: implicit declaration of function '_netif_rx_schedule_prep'" when you select the NAPI option.

The solution is edit ixp400_eth.c,before edited:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)

priv_data_t *priv = netdev_priv(ndev);

if(napi_schedule_prep(&priv->napi))

{

ixEthAccQMgrRxNotificationDisableQueue(i);

ixQMgrNotificationDisable(i);

__napi_schedule(&priv->napi);

}

#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)

priv_data_t *priv = netdev_priv(ndev);

if(netif_rx_schedule_prep(&priv->napi))

{

ixEthAccQMgrRxNotificationDisableQueue(i);

ixQMgrNotificationDisable(i);

__netif_rx_schedule(&priv->napi);

}

done the edit:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)

priv_data_t *priv = netdev_priv(ndev);

if(napi_schedule_prep(&priv->napi))

{

ixEthAccQMgrRxNotificationDisableQueue(i);

ixQMgrNotificationDisable(i);

__napi_schedule(&priv->napi);

}

#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)

priv_data_t *priv = netdev_priv(ndev);

if(netif_rx_schedule_prep(&priv->napi))

{

ixEthAccQMgrRxNotificationDisableQueue(i);

ixQMgrNotificationDisable(i);

__netif_rx_schedule(&priv->napi);

}

finnlay,you need to type a few command lines after booting the ixp4xx-board:

# insmod ixp400.ko
# cat /etc/IxNpeMicrocode.dat > /dev/ixNpe
# insmod ixp400_eth.ko

ixp400_eth: Initializing IXP400 NPE Ethernet driver software v. 1.7SG
ixp400_eth: CPU clock speed (approx) = 266 MHz
[warning] ixNpeDlNpeMgrInit - Warning:NPEA is not present.
ixp400_eth: ixp0 is using NPEB and the PHY at address 0
ixp400_eth: ixp1 is using NPEC and the PHY at address 1
ixp400_eth: Use default MAC address 00:02:b3:01:01:01 for port 0
ixp400_eth: Use default MAC address 00:02:b3:02:02:02 for port 1

dont even think that you have done all works of port.of course no~your ixp420 needed 2 network cables plug into 2 RJ-45 interfaces which one for TX and another for RX.I dont figure it out yet.Im still hacking on it.I found out that some functions which writing datas into registers of ip175c net chip got something wrong.Now the ixp4xx can writing the data correctly but still cant send or receive the datas from network within one network adapter.

port is a muscular work,definitely:-)