Programing for new device

!!!! why you tring to answer !!!! you can't!!!

i have no idea about what you just said
well
i know c and c++ and perl and i don't know git-repo and i have the time
but the thing is thank you ,you can't help
clearly you aren't familiar with developing and programing with php or c# or vb or c++ or any visual studio
or web development that's why you're avoiding the questions
anyway thank you
could anyone please read the posts and answer all of my questions
any one that understand what i mean routers use systems like any other device and there mast be a tools and os and things like visual studio and Apache24
language that they use like php or c# etc ....
and there must be a steps to create firmware for a new device using openwrt system
building it on pc or what i don't know and that's why i am asking but please agine anyone who answer me don't ignore any point and explain step by step and don't answer if you don't know
and thank you all

You need gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff,
unzip, gawk, getopt, subversion, libz-dev and libc headers installed.

AND

C 62.1%
Makefile 16.3%
Shell 7.8%
C++ 6.2%
Roff 3.4%
Perl 2.1%
Other 2.1%

Use any IDE you are familar with, I like vi

You should think of openwrt as a Linix distro that specialises in routers. It is a lot of C code and Makefiles and Scripts etc to build all the bits to make a complete distro. In the end you have a firmware image that you install on your routers flash. You can add all sorts of packages that others have built or make your own. Anything you build is going to be cross-compiled using GNU toolchain.

It is recommended to use a PC with a Linux Distro or MAC to develop and build. If your new to Unix like systems maybe learn that first.

I haven't given a simple answer, because this is not a simple project. You are going to need to make an effort to learn a few ( actually a lot ) of new things.

Be patient it is going to take you weeks and months.

Maybe buy your self a used router that is supported by openwrt. I picked up a Netgear WNDR3700v2 for $10 and I am using it to experiement and learn. I haven't done any development yet but once I have finished my learning process I will. For now I am trying to understand the build system and have made a few practice builds to make sure my build/development enviroment is setup correctly. FYI I am using archlinux but Debian or Ubuntu are better recommendations.

Good Luck.

Don't be afraid to read and gain some knowledge

EDIT:

Forget about using Visual Studio on Windows that would be a nightmare.
If you like Visual Studio you could use Ubuntu and Install Visual Studio Code on your ubuntu system for example. As far as building it is just a "make" you could setup whatever IDE you like to run make. I prefer to build from the command line.

You can find Ubuntu here
You can find Visual Studio Code here

I hope you find that helpful,

@harvey_84, As it doesn't seem like you've got a lot of experience with OpenWRT, and my apologies if that is not correct

32 MB (RAM) devices are insufficient for general use

https://openwrt.org/supported_devices/432_warning

Note that the 4/32 warning is, itself, outdated. You should expect that a 32 MB device will not be stable in use, and that it will be dropped from support without warning in any future version, and that it will not receive, nor will it be able to accept security updates for the kernel, drivers, or any application code.

If you still want to pursue porting OpenWRT to this obsolete, inadequate device, you will primarily be working with Linux kernel code. This will require knowledge of C and use of git.

There is no "standard" IDE for C code. Many use straight text editors. Some use Visual Studio, CLion, or the like, but the advantages for the Linux kernel code base are relatively small, especially as it isn't built as a cmake project.

You will need a functional Linux-based OS as your build machine. You will need to follow the directions you have been given. Until your skill set is sufficient to install basic development tools on a Linux-based OS, it is unlikely that you will have any success either building or debugging a build for your device. Anyone you interact with in a kernel-level development community will expect that you have basic skills with the OS and its tools.

You have been given the links for how to install the build system above. If you do not have the skills to follow them, you should seek out a "Linux for beginners" forum, or otherwise gain those skills. Specific questions are one thing, asking to be led through a "standard software install" is another.

the last one is right
Anyway
RTL8676 is some old Lexra cpu core, there are some MIPS commands missing, which must be emulated.
you out of luck here.

Lexra is not supported directly by gcc like MIPS, ARM, x86 etc. are. This means that even compiling the first line of C code requires a lot of modification to the system.

Also Realtek does not have good open wifi drivers.

first thank you all
@mbo2o,@jeff
You should think of openwrt as a Linix distro

that explain a lot
i didn't deal with Linux much but i know the basics and i have some skiles

and to clear some things i have a linksys router that is supported by openwrt
but the manufacture firmware is good so i didn't think to change it it's my mean router
i don't want to experiment on it you get it

those router above
they are locked to work with one isp and a lot of things locked so it's worthless
that's way i want to experiment on it

i know that 32mb for openwrt is the min but any openwrt version would be better than this
so i thought since it Linux distro i can download the min version of it and with a few edit i can make firmware to my router

like the ubuntu i can install it to any device that has the minimum requirement

and i also thought that editing the openwrt distro to work with my router won't be hard since i have
knowledge of c and c++ and c# and perl
even if it require to learn something new it won't be hard
so the good question here can i make openwrt to work with any router from the above

if yes then tell a way to start
if no then how i can extract the firmware from my router and edit it or any solution?

and thank you all for your time
i appreciate it
thank you

Hi @harvey_84,

Although you can find the Openwrt firmware for many devices, it is not available for all (any) device.

The reason being the hardware is not standard like your X86 PC. For example not all the wireless radios have drivers available for linux. There is a variety of CPUs and SOCs in use by all the manufacturers and models been made. They may be part of the MIPS and ARM architecture, but not all are fully supported.

The short answer is your goal of recycling your ISP routers is great but unfortunately they are not currently supported. Which simply means you won't be able to install Openwrt on them at all.

If you are still interested in trying Openwrt try and find another supported router to work with.

@mbo2o
you mean no way i can make openwrt for those routers?
doesn't matter the skills or even to make a copy for min use?

is there a way to extract the firmware and edit it ? any solution

No, you would need to build it from source. Binary executables "can't" be just "edited".

1 Like
  1. You have been told already:

For more explanation, see: https://openwrt.org/supported_devices/432_warning

  1. You have been told already:

Visual Studio is a Microsoft language.

Please do not insult those who respond to your thread.

Why?

Then, flashing OpenWrt on your device is not for you.

IF YOU'RE WILLING TO DO THE WORK YOURSELF, THEN YES.

You have been told:

I took time to customize the answer so you'd be likely to say: "OK, I UNDERSTAND." Not due to anger.

Did you get how to install the OpenWrt firmware on your device or not, though?

My mother is a human.

It's your choice as to how to proceed. You've been told quite clearly that

  • You can't "edit" a binary image
  • You would need to build from source
  • The processor in your device is unsupported
  • The driver code for some of the devices is of poor quality
  • Your device is woefully under-spec-ed for current requirements for minimal operation

Unless you're willing to learn how to build Linux kernel, have the skills to deal with the manufacturer's data sheets and specifications, the skills to debug the results, and the skills to modify Linux kernel source and drivers, you are unlikely to ever get OpenWRT running on your device.

There is no need to repeat the questions -- you have been given the answers.

1 Like

@jeff
i am no repeating the question
you just said you can't
i just searched and found tools like binwolk that extract bin file
so i didn't take your "answer" to be correct
and i "repeated" it so someone with more experience would answer
and i am a programer too of course i am not like you ,your professional i am someone who insult people you know visual studio php ,c#,c,c++ ,js,perl and some linux experience and many other
so you can just ignore my repeated question and just answer the profinal one
and leave that to the beginner like me okay

@lleachii
if i insult you be say visual studio and it's an insult
then telling me that i'm a stuipe is not an insult
the wrong is not yours it's the forum admins who allow it

and i didn't get how to install openwrt because no one seem to care they just want an easy question
like i have openwrt installed and i need to install vpn on it !!!!!!
not because i am a stupid

and you know what your provoking son of a bitch and i know that you like it
otherwise you won't post again
go to doctors get help you're one of those people who love being insulted
i can go on all day and insult you but i won't feed your need of feeling filthy and dirty

to the forum admins who hide me post
you hide my post and allow his
if that is your logic can you just delete the topic and my username

:rofl:

if (extracting == editing)
  puts("The answer of @jeff isn´t correct");
else
  puts("@jeff answered your question correct");

month=12;
if (familiar_with_mips_asm)
  do {
    coding_and_debugging_day_and_night();
  } while (month--);

Your answer(s):

https://git.openwrt.org/?p=openwrt/openwrt.git

3 Likes

The only rainbow here is that mips_asm is easier than x86_asm

https://courses.cs.washington.edu/courses/cse378/03wi/lectures/mips-asm-examples.html

And you will need some disassembly tools too.

1 Like

Taking a more practical approach

Contact the manufacturer of the router and explain to them you would like to do your own research and development on their device and would they be willing to provide you with any of the source code.

They may ask you to sign a non-disclosure agreement.

They may charge you a small fee to dig up the old code.

This would be a lot more practical than ending up with 100,000 lines of assembly code in mips and trying to make any sense of it in this life time.

1 Like

@juppin
good one

but MIPS !!
i don't think so

@mbo2o
i did extract the bin files using binwalk
but i am still trying to understand the code there is a lot of files some of them is c and js and xml
and some of them i don't know they written with what no extinon
anyway i will try to edit it just to unlock the things that is locked and rebuild it and try

as for openwrt i may try install on pc just out of curiosity to see that code and to understand why i can't install it on any devices
because i am still don't get it
it's linux system that install on a lot of router and pc
why i can't get the minimum one of it not that entire features like debian for ex if you try to download it you will find many copies one that basice and the other has more features
like ubuntu server and desktop
you get it
i just looking to code any copy of it and replace that firmware
any copy that has basic features lily ,adsl, lan and wan ,nat ,dmz simple

and thank you bill,juppi

@harvey_84 extracting bin files, or say, all rootfs tree and kernel is the one of very first step in digging on the unsupported device. Second step would be reassembling all this extraced in to new(modified) firmware file and make this file acceptable/flashable/bootable by the router's bootloader/firmware. Try to do this second step. Connect UARTtoTTL adapter to your board serial console pins and share here bootlog from your device. Take clear photos of your device PCB, read full flash dump by SPI flash programmer and share it.

1 Like

unfortunately it's mostly shell code
look at the first line of the file, it's
#!/bin/sh
shell code and c (from old days) are similar

we don't need extensions

ls /bin/busybox  -l
-rwxr-xr-x    1 root     root        393257 Jul 15 14:30 /bin/busybox

The x is the magic.
please read a beginner unix/linux book about this.

You can,t install a repository, only clone, fetch.
Please read here about git
https://git-scm.com/

From a beginner POV yes.
It's a linux system, but tailored on a SoC aka system on chip and there are lots of them.
In every color, size of shape, to explain this in simple words.
And every device has his very own restrictions

But here you must bite the bullet

RTL8676S is an RTL8676 with embedded SDRAM and some outdated Lexra
LX5280 cpu core
Read here about the LEXRA case
https://www.linux-mips.org/wiki/Lexra
And for the entire Realtek LEXRA suport read here
https://forum.openwrt.org/viewtopic.php?id=46606

unless you have a RTL8197F which is a true MIPS compliant, I would not do such a work

I advise you please use a well supported device and play with openwrt.
Don't use this kind old and outdated devices for a beginner

2 Likes